I’m using the cycle plugin to bind some functions before and after a slide is shown, this works fine using the before and after callbacks but the functions are also fired when the plugin initially loads, here’s a simplified version of the code:
$(function() {
$('.slider').cycle({
before : function() {
alert('this shouldn\'t appear on cycle load');
},
after: function() {
alert('this shouldn\'t appear on cycle load');
}
});
});
See JS Fiddle for example. The alerts are shown right after the page loads and also before and after each slide transition, is there a way to prevent this?
Thanks in advance.
You should be able to specify
skipInitializationCallbacks: true(undocumented) in your options to avoid getting the callbacks on startup.Fiddle