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
-
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
-
-
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login