Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Header menu scrolling
- var scrollLink = $(".scroll");
- scrollLink.click(function(e){
- e.preventDefault();
- $("body,html").animate({
- scrollTop: $(this.hash).offset().top
- }, 1000);
- });
- // Menu Active scrolling
- $(window).scroll(function(){
- var scrollbarLocation = $(this).scrollTop();
- scrollLink.each(function(){
- var sectionOffset = $(this.hash).offset().top - 30;
- if ( sectionOffset <= scrollbarLocation ) {
- $(this).parent().addClass("active");
- $(this).parent().siblings().removeClass("active");
- }
- })
- })
Add Comment
Please, Sign In to add comment