Enable and disable the click event for image using Jquery? -
i having image.when image clicked show info animation.so want disable image upto info shown in browser.then 1 time info loaded need enable image.
for illustration
$("#imageid").click(function(e){ //disable click $("idforanim").animate({left : "-=50 "px"},500,function(){callfunction1();}) }) callfunction1(){ //show info //enable click }
how can accomplish this?
another way set flag indicate info still beingness processed , unset flag on completion:
var processing = false; $("#imageid").click(function(e){ if ( !processing ) { //disable click processing = true; $("idforanim").animate({left : "-=50px"},500,function(){callfunction1();}) } }) callfunction1(){ //show info //enable click processing = false; }
jquery
No comments:
Post a Comment