• Resolved RafaelDeJongh

    (@rafaeldejongh)


    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)
  • Theme Author Tom

    (@edge22)

    Hi there,

    GeneratePress itself doesn’t have smooth scroll by default.

    However, our premium version does. It can be turned off in Customize > General.

    If you’re not using premium, then it’s possible you’re using a plugin that has smooth scroll activated by default.

    Thread Starter RafaelDeJongh

    (@rafaeldejongh)

    @edge22

    Hmm that’s strange, then it might have something to do with Elementor, might see if they have something to do with it.

    I am using the free version, and I thought it had because the back to top button had a smooth scroll animation.

    But well if it does not I guess it is Elementor as I do not have any other plugins that actually have any smooth scroll by default.

    Thanks for the fast response, I’ll go hear with the Elementor team!

    Theme Author Tom

    (@edge22)

    No problem! Hopefully you’re able to get it sorted ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Smooth Scroll’ is closed to new replies.