Answer the question
In order to leave comments, you need to log in
How to track every third jQuery click?
I have a certain block that needs to be updated every third click on the selector - please tell me how to do this?
Here, I found a solution for every second click .. is it possible to cut it somehow? (
Answer the question
In order to leave comments, you need to log in
And that's it, I found a solution .. suddenly it will come in handy for someone:
$elem.click((function() {
var count = 0;
return function() {
count++;
if (count % 3 == 0) {
alert("Click #" + count);
}
}
})());
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question