The main problem is that you do not interact with the symbols when re-displaying them. In this case, the only way to prevent the user from clicking is to create a method that allows you to double-click twice using a timeout.
This method will look something like this:
function clickThrottled(fn) { var click = true; return function () { if(click) { click = false; fn.apply(this, arguments); setTimeout(function () { click = true; }, 1000); } }; }
Then you use this function as follows:
$('.character').click(clickThrottled(function () {
What I'm using here is closing JavaScript. The function that you pass to the click event handler will only call the base function once, and then ignore all calls for 1 second, and then activate itself again.
I would still suggest that you go with the usual method of simply reactivating the elements when they are redrawn on the screen - but the above also works.
source share