That’s the code I used inside custom <head> content of my friend’s site to make the smooth scrolling work. If anyone has some input why this hides all content I’d be very grateful:
<script>
window.laytheme.on('newpageshown', function(){
if(window.location.hash.length > 0){
var id = window.location.hash;
if(jQuery(id).length > 0){
jQuery('html, body').animate(
{ scrollTop: jQuery(id).offset().top },
{ duration: 1200 });
}
}
});
</script>