malsup / cycle

jQuery Cycle Plugin - Slideshow goodness
http://jquery.malsup.com/cycle/
1.19k stars 307 forks source link

Check if CYCLE is initialized #141

Closed didoweb closed 11 years ago

didoweb commented 11 years ago

Hi, I've got a question about checking if Cycle is initialized or not.

I've got a responsive site and I init Cycle on resize when the size is big than a value. Before I do that, I want check if cycle is initialized yet. How I can do that? This is the example:

if( $(window).width() > 767 && !$('myID').(CHECK CYCLE) )

Thanks, Davide

malsup commented 11 years ago

You can test to see if Cycle's data object has been set on the slideshow object:

$('myId').data('cycle.opts') !== undefined

But for responsive slideshows you're much better off using Cycle2:

http://jquery.malsup.com/cycle2/

didoweb commented 11 years ago

Thanks a lot.

Davide