Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

offset broken on dom update #49

Closed
RyanMulready opened this issue Jul 31, 2013 · 3 comments
Closed

offset broken on dom update #49

RyanMulready opened this issue Jul 31, 2013 · 3 comments
Labels

Comments

@RyanMulready
Copy link

When scrolling to an element and using offset it appears the calculation is made based on the first view of the dom. Any changes to the dom and the offset behaves incorrectly.

@flesler
Copy link
Owner

flesler commented Jul 31, 2013

Not 100% sure what you mean, the plugin won't auto update the scroll if you move elements around or change the dom in any way. Think of this plugin as a wrapper to $().animate()

@RyanMulready
Copy link
Author

It's hard to explain outside of the context but this jsfiddle may help: http://jsfiddle.net/r8WZt/8/

Essentially the object I'm scrolling to is inside a toggled div. When the first scrollTo is triggered the offset works fine but subsequent scrollTo to the same object the offset is wrong.

@flesler
Copy link
Owner

flesler commented Jul 31, 2013

Not sure what this demo tries to achieve, you are scrolling to the element
with id "6" that is hidden unless you expand, so there's no point in
scrolling unless it's visible (btw ids shouldn't start with a number). Once
you "expand" and scroll, the plugin seems to be respecting the offset
correctly. Trying this on Firefox Mac.

On Wed, Jul 31, 2013 at 12:16 PM, Residual Envy notifications@github.comwrote:

It's hard to explain outside of the context but this jsfiddle may help:
http://jsfiddle.net/r8WZt/8/

Essentially the object I'm scrolling to is inside a toggled div. When the
first scrollTo is triggered the offset works fine but subsequent scrollTos
to the same div the offset is wrong.


Reply to this email directly or view it on GitHubhttps://github.com//issues/49#issuecomment-21870558
.

Ariel Flesler

@flesler flesler closed this as completed Jan 13, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants