facetwp scrollTop example with wp_head hook

djrmom

{{gist file=”custom-hooks.php” lang=”php”}}

(function($) {
$(document).on(‘facetwp-loaded’, function() {
if (FWP.loaded) {
$(‘html, body’).animate({
scrollTop: $(‘.facetwp-template’).offset().top
}, 500);
}
});
})(jQuery);

<?php } );
{{/gist}}