I'm modifying the lovely jquery.carousel.js plugin to have an autochange feature. I want to use setInterval() to call a function, but I can't get it to play nice.
Here is the code I have at the moment:
autoSwitch: function()
{
if(runAuto)
{
$('.next').click();
}
},
init: function(el, options) {
if(this.options.auto)
{
setInterval("this.('autoSwitch')", this.options.autoTime);
}
}
This is just a snippet and there is other stuff, but I've left the important bits in.
The line I'm having trouble with is setInterval("this.('autoSwitch')", this.options.autoTime);. Whatever I try in the first argument of setInterval, it just doesn't work. So. Can you awesome people help me out as to how I call autoSwitch() from the setInterval() function please?