This is cool and I am familiar with this. However I want the next and previous buttons to stay visible, just not be click able. In my particular situation, the buttons are images that are part of the design. I just want the user to not be able to click through before an animation ends.
A:
$('#mybtn').attr("disabled","disabled"); // to Disable Button
$('#mybtn').removeAttr("disabled"); // to Enable Disabled button
Shota Bakuradze
2010-09-01 14:16:36
+2
A:
$(function(){
$("#previous").bind("click", Previous);
$("#next").bind("click", Next);
});
function DoAnimation() {
$("#previous,#next").unbind("click");
$('#id').animate(
complete: function() {
$(this).after('<div>Animation complete.</div>');
$("#previous").bind("click", Previous);
$("#next").bind("click", Next);
}
});
}
function Previous() { }
function Next() { }
hunter
2010-09-01 14:19:05
A:
I guess you have javascript calls for the images onclick's, use a variable MyApp.IgnoreNextPrevClicks
to flag whether the onclick handlers do execute or not.
MyApp={}
MyApp.IgnoreNextPrevClicks=false;
MyApp.PrevClick=function() {
if(MyApp.IgnoreNextPrevClicks) return;
//real work goes here
}
now before calling the jquery animator, set MyApp.IgnoreNextPrevClicks
to true, and set it back to false after the animation ends (use jquery animation callback).
aularon
2010-09-01 14:22:14