zurb / orbit

454 stars 96 forks source link

Orbit slider doesn't work for me if its container is initially hidden #128

Open billyroebuck opened 11 years ago

billyroebuck commented 11 years ago

I'm using ZURB's Orbit slider within a custom made accordion. If the accordion container is hidden when the page loads, and then clicked on, the slider doesn't work.

Has anyone run into this issue? Any ideas on how to fix this?

sam3k commented 11 years ago

same here. This happens to me when the slider is a partial that has just been loaded. My temporary work around for this was to set a timeout to ensure that the view is loaded before the slider is initialized.

billyroebuck commented 11 years ago

I haven't had a chance to try this yet, but I wonder if calling the orbit function via JavaScript when the panel is displayed would solve the issue. E.g. $("#featured").orbit();