Skip to content Skip to sidebar Skip to footer

Can Clicking Too Fast Skip Some Operations In Jquery Mobile?

I have a jQuery Mobile app displaying a list of items. I can select an item and move it up or down when clicking an up or down button. When I move an item up or down by clicking t

Solution 1:

This is an expected outcome, you have click event bound to the btnListUp and btnListDown elements. Next click event is not going to wait for the first one to finish, nor will first one postpone the second one.

In your case only two solution are possible.

Solution 1

First, after the first click, unbound the click event from the button, like this:

$("#btnListUp").on( "click", function(evt)
{
    $(this).off('click');

Second, during the ajax success and error callback bind the click event again. This is one way.

Solution 2

Second solution is an easier one but sometimes you will no be able to use it:

Take a look at this link:

Disable jquery function after 1 click, to prevent multiple executions

Post a Comment for "Can Clicking Too Fast Skip Some Operations In Jquery Mobile?"