one page navigation scroll effect of JavaScript code || scroll on specific

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;

  });

});


Take a look - Live demo 

 Using this script you can stop scrolling on the specific position and  height or  set pixels from top -100 or 0px  any think.

Post a Comment

0 Comments