I am expanding/collapsing a div using a click event bind on the div.
The expand/collapse takes place using
$('#myid').animate(myfunctiontocollapse/expand).
Now for instance height of div is zero and i click on div to expand it and i click it again before completion of its expansion,the code for collapse is called and div gets out of shape.
How can i prevent click event for the second time when collapse/expansion is going on?
I am expanding/collapsing a div using a click event bind on the div. The
Share
You can check to see if it’s still animating in the click function and if it is then return false to prevent default click action and propagation.