Smooth Scroll
-
So I wanted to have a bit more flexibility on my Smooth Scroll especially when I modify my main header’s height, I here for used the following code:
jQuery(document).ready(function($){ //Smooth Scroll $(function(){ setTimeout(function(){ if(location.hash){ window.scrollTo(0,450); target = location.hash.split('#'); smoothScrollTo($('#'+target[1])); } },1); $('a[href*="#"]').not('[href="#"]').not('[href="#0"]').click(function(){ if(location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname){ smoothScrollTo($(this.hash)); return false; } }); function smoothScrollTo(target){ var nav = $("#SHSHeader").height()+20; if(target.length != 0){ target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); if(target.length){ $('html,body').animate({scrollTop:target.offset().top-nav},1200); } } } }); $(window).bind("mousewheel",function(){$("html,body").stop(true,false);}); //End });
Yes this seems to be conflicting with the already included Smooth Scroll by GeneratePress, I was wondering where I can find the original Smooth Scroll to either deque it and replace it by mine OR modify it to fit my needs OR request a feature that you can adjust the offset of the smooth scroll by X amount of pixels AND have an option to have scroll from top to anchor point if you come from a new page.
Thanks in advance for further information.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Smooth Scroll’ is closed to new replies.