Click on a "Read more" link. You'll notice how an article will contract, and then another one with more content will expand in its place. Im very happy with how this works.
After that, the script attempts to scroll down to the article it just opened. The first time this works just fine, but now try clicking "Read more" on another article. The old article will close, and the new one will open, and you will be scrolled down to it. If you just clicked an article located below the one you we're just looking at before, you'll experience that the page has scrolled down too far.
The distance scrolled seems to be the right distance, plus the height of a contracted article.
And if you open an article located about the one that is currently open, the problem will not occur.
I have tested this in both Chrome and Firefox, same issue.
The code executed when you click the "Read more" link is located here:
Rather than delaying the scrollTop() call, maybe try doing it on the callback of slideToggle(). That way you won't be getting the position of the article before the other one has closed and the new one has opened (I think...)
Leave a comment on kerry.kim.russo's reply
Change topic type
Link this topic
Provide the permalink of a topic that is related to this topic