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.
$("#carousel").jCarouselLite({
vertical: true,
btnNext: ".btn-down",
btnPrev: ".btn-up",
visible:6,
circular: false
});
$("#carousel .btn-down").hover(function() {
$("#carousel .btn-down").click();
});
but it only fires once when mouseover, i need it to fire continueously while mouseover.
I too had the same problem with my code, then I came up with this solution..
That did the trick for me. Hope it helps you.
You can set an interval for clicking like this, just do the same for the opposite button:
You can use
setInterval
to begin triggering the event at regular intervals on hover and useclearInterval
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: