Im pretty sure this has a simple solution. I am using jCarousellite, and i want to change the behaviour of built in nav buttons to fire on hover over.
$(\"#
You can use setInterval
to begin triggering the event at regular intervals on hover and use clearInterval
to stop it when the user stops hovering. It'd also be cleaner to trigger the actual behavior you want instead of triggering a click event, assuming the plugin you're using supports such an API. Something like this:
var effectInterval;
$('#carousel .btn-down').hover(function() {
effectInterval = setInterval(function() {
$('#carousel').advanceToNextImage(); // sample API call, check your plugin's docs for how it might actually be done
}, 5000);
}, function() {
clearInterval(effectInterval);
});