我要完成的动作时确认-》取消确认-》最后还回到确认状态。
这样的步骤如何实现
这样操作:
$(function(){
$("#mybutton").click(function(){
$(this).button("loading").delay(1000).queue(function(){
$(this).button("complete").delay(500).queue(function(){
$(this).button("reset");
$(this).dequeue();
});
$(this).dequeue();
})
})
})不知道怎么获取button的状态,想了一个办法:
$(function(){
$("#mybutton").click(function(){
console.log($(this).text());
if ($(this).text() == "确认") {
$(this).button('loading').delay(2000).queue(function(){
$(this).button('complete');
$(this).dequeue();
});
} else {
$(this).button('reset');
}
});
});