one page navigation scroll effect of JavaScript code
Add scroll-behavior: smooth to the <html> element to enable smooth scrolling for the whole page (note: it is also possible to add it to a specific element/scroll container):
Query(document).ready(function( $ ){
$('.hfe-menu-item').click(function(){
$('html, body').animate({
scrollTop: $( $(this).attr('href') ).offset().top-100
}, 2000);
return false;
});
});
Using this script you can stop scrolling on the specific position and height or set pixels from top -100 or 0px any think.
0 Comments