Staffan Estberg
Staffan Estberg

Reputation: 7035

How to check if jQuery Cycle is initiated

I have these previous/next a elements that tie in with the functions of jQuery Cycle, however I don't want to show the buttons if the plugin is not initiated (i.e. too few slides). I've looked through the Options page (http://jquery.malsup.com/cycle/options.html) but I can't seem to find a reference to this.

$('#content ul').cycle({ 
  fx: 'scrollHorz',
  speed: 750,
  prev: '#previous',
  next: '#next',
  timeout: 4000
    "onInit.function() / conditional statement" {
      $('#previous').fadeIn();
      $('#next').fadeIn();
    });
});

Upvotes: 0

Views: 1966

Answers (1)

Mbrevda
Mbrevda

Reputation: 3080

if (jQuery().cycle) {
  //do something
} 

http://jquery-howto.blogspot.com/2009/03/check-if-jquery-plugin-is-loaded.html

Upvotes: 3

Related Questions