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

Calling swipe on a hidden element doesn't work #11

Closed
owain opened this issue Nov 11, 2011 · 1 comment
Closed

Calling swipe on a hidden element doesn't work #11

owain opened this issue Nov 11, 2011 · 1 comment

Comments

@owain
Copy link

owain commented Nov 11, 2011

If swipe is in a page that is hidden (e.g. a page that hasn't been shown yet) then initialising it won't work...

example: http://jsfiddle.net/4a2yy/4/ - press the show link to show the element

It's likely something to do with getting the width of the list elements but I have had a chance to debug it yet. Is this something you've see before? One solution is to call an event on showing the page and call the swipe when it fires...but this isn't ideal.

Thanks.

@thebird
Copy link
Owner

thebird commented Nov 14, 2011

Swipe runs a few calculations off of the element which requires the element to be visible at the time of calculating. A quick solution is to trigger the .setup() function once the slider is shown (in this case the onclick event).

I'm not sure if there is a better solution but I will let you know if I find one.

@thebird thebird closed this as completed Nov 17, 2011
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