Multiple anchor points smooth scroll and issue at top
-
Hi there, I have a bunch of text links in a text block, in a row at the top of my page.
For each text link I have clicked 'link' and then entered an ID which corresponds to an ID I have given each row below in the gridder.Works like a dream to navigate apart from on one or two pages where if after clicking and navigating to a row with the aref link, when you scroll back up to the top of the page it cuts off some of the very first row at the top UNLESS you scroll all the way to the bottom of the page and then back to the top. After that it works all the time, weird. Any thoughts?
Also I wanted to smooth scroll all my anchor points. If ound another thread on here and armin had written this jQuery for someone:
jQuery(document).ready(function(){
jQuery('body').on('click', '.js-scrollTo', function(event) {
event.preventDefault();
var id = jQuery(this).attr('href');
jQuery('html, body').animate( { scrollTop: jQuery(id).offset().top }, 750 );
});
})It doesnt really work for me, even if I try replacing the class with my ID. Ideally id like a bit of jQuery that animates all anchor point links. I can easily enter all the IDs if I have to though.
Do you have any ideas on this?
Thanks!
Duncan
Before you post:
- When using a WordPress Cache plugin, disable it or clear your cache.
- Update Lay Theme and all Lay Theme Addons
- Disable all Plugins
- Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code", click "Save Changes"
This often solves issues you might run into
When you post:
- Post a link to where the problem is
- Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
- If the problem is difficult to explain, post screenshots / link to a video to explain it