1
I have the following code snippet:
var Tannerie = {
init : function(){
$('#prev').mouseover(Tannerie.prevClick);
$('#next').mouseover(Tannerie.nextClick);
},
prevClick : function(){
$(this).click();
},
nextClick : function(){
$(this).click();
}
}
$(Tannerie.init);
That is, when I pass the mouse by a certain div it simulates a click. But I wanted to make sure that, by leaving the mouse on the div, that it keeps giving continuous clicks. I tried to use setInterval but it didn’t work, but I guess I didn’t do it right.
The ideal would be to put a
setInterval
and put aif($('#elem').is(":hover"))
and in theelse
disable thesetInterval
.– Felipe Avelar
This will lock the browser, need a setInterval as said Felipe.
– bfavaretto
Yes, I’m sorry, I forgot to mention that. Anyway, anyone who can test, do a jsfiddle and give feedback to see if it solves the boy’s problem =)
– mend3