Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Flotto

    (@flotto)

    I removed the link at the above page.
    Still I would like an answer to my question, the page scroll link on https://huisje-wageningen.nl still works.

    Plugin Author malihu

    (@malihu)

    There’s no option within the plugin core to do this but you could do it if you could add a custom script in your page(s) and/or templates.

    Example

    Add the following in your footer.php (e.g. after wp_footer()):

    <script>
    	(function($){
    		$(window).load(function(){
    			$(".ps2id-stop").click(function(e){
    				e.preventDefault();
    				var el=$("html,body");
    				if(el.is(":animated")) el.stop();
    			});
    		});
    	})(jQuery);
    </script>

    Give the element you want to stop page scrolling the class:

    ps2id-stop

    This way, when you click an element with class ps2id-stop it’ll stop page scrolling.

    The script above could of course be added in other template files (e.g. header.php), as a php function in functions.php or in your theme’s custom js.

    Let me know if this helps.

    Thread Starter Flotto

    (@flotto)

    Hello Malihu,
    Thanks for your quick reply. I use the Weaver Xtreme theme with many options to insert code.
    However, until now I didn’t find the right way where and how to do it.
    It would be nice if you can include this option in an future update of Page Scroll to ID.
    Thanks anyway for your nice plugin!

    Plugin Author malihu

    (@malihu)

    Thanks for the suggestion! I’ve already added such feature in plugin’s todo list ??

    If there’s a field in your theme settings to insert custom javascript code, you could add:

    (function($){
    	$(window).load(function(){
    		$(".ps2id-stop").click(function(e){
    			e.preventDefault();
    			var el=$("html,body");
    			if(el.is(":animated")) el.stop();
    		});
    	});
    })(jQuery);
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Stop scrolling at mouse-click’ is closed to new replies.