Results 1 to 6 of 6

Thread: Anchor Jumping Issue with bookmarkscroll.js

  1. #1
    Join Date
    Feb 2012
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default 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!

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    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
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Feb 2012
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    John, that's perfect! Thanks so much!

  4. #4
    Join Date
    Feb 2012
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    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!

  5. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Use this updated version (right click and 'Save As'):

    Attachment 4588
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  6. The Following User Says Thank You to jscheuer1 For This Useful Post:

    frank_nito (08-15-2012)

  7. #6
    Join Date
    Feb 2012
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Thank John!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •