-
Anchor Jumping Issue with bookmarkscroll.js
1) Script Title: bookmarkscroll.js
2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...markscroll.htm
3) Describe problem: I have the script implemented correctly. However, when I scroll to something in the middle of the page, it causes an abrupt jump to the top of the browser. This DOES NOT happen when I scroll to the very bottom or very top, only when I scroll to something in the MIDDLE of the website where the scroll bars don't hit the very top or bottom...
Sample here - http://www.that-creativeguy.com/index6.html. Click to scroll to the MIDDLE SECTION and you will see what I am referring to. It is an abrupt jump instead of a smooth transition and stop to that section of the site.
Please help!
-
-
It happens at the bottom too, at least in some browsers.
Anyways, strikes me as a bug in the script. When using the yoffset, if it's appreciable (as it is in your case, -100), the jump from it to the actual hash is noticeable. And the way the script is currently written, that's exactly what happens after the smooth scrolling animation has ended, it jumps to the actual hash/named anchor. Use this version instead:
Attachment 4372
It jumps to the hash/anchor first, then retraces its movement to the prior position so quickly that you can't tell that anything has happened. Then it smoothly scrolls to the yoffset of the named anchor.
The problem arises in the first place by the script trying to preserve the hash in the URL - a good thing. But doing so after the animation as it was made it jump if the yoffset was anything more than 1 or so.
-
-
John, that's perfect! Thanks so much!
-
-
Hey John, I am back again with another quick question...Why is it that the bookmarkscroll.js, in Chrome (PC and MAC) and Safari (MAC), jumps back to the top and then scrolls down to the designated anchor.
Check out this example...go here again - http://www.that-creativeguy.com/index6.html.
Click the "Middle" link, let it scroll to the middle. Then, click the "bottom" link and you will see that it jumps back to the very top and then scrolls down to the bottom anchor. Can you help me out with this, please? Thanks!
-
-
Use this updated version (right click and 'Save As'):
Attachment 4588
-
The Following User Says Thank You to jscheuer1 For This Useful Post:
-
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks