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

scrollable seekTo with callback. #29

Open
d4n4 opened this issue Nov 6, 2011 · 1 comment
Open

scrollable seekTo with callback. #29

d4n4 opened this issue Nov 6, 2011 · 1 comment

Comments

@d4n4
Copy link

d4n4 commented Nov 6, 2011

Hello-

First thank you for writing this cool tool.

Does the seekTo() with function work so that all animation is complete prior to calling the function in the callback? ? If not how do I do this?

I've been working on a site (http://pie3.keene.edu/djc/index.html and the site uses your scrollable tool in conjunction with jQueryUI accordions and some ajax. I'm working on statefulness using hashes-
hash is read, looked up and a page index number and an accordion index is returned. Then I call the seekTo(index, function(){}) and within the function I make a call to open the accordion to the prescribed index. I'm finding that often when the site is responding to a bookmark, the page seems to be stopped 1/2 way through the scrolling to the page via seeTo() and the accordion is then opened. This sets the pages all offset by about 1/2 the screen- and I'm wondering if perhaps my call the the accordion API is being executed prior to the completion of the scrollable animation.

Can you assist? If there's no guarantee that the callback is waiting for the end of animation, is there a way to make this happen?

Best,

Dana

@Pixelfish
Copy link

I think rather than seekTo(index,function(){}) you need to do seekTo(index,speed,function(){}). Using the callback as the third parameter worked for me. In the scrollable documentation it says the method takes two parameters: index, and speed. However I believe there is a third parameter which is an optional callback function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants