我试着在发送表单但没有工作时启用和禁用此函数,我将此函数放在这里:
jQuery("#c_input_submit").attr('disabled','disabled');
jQuery("#c_response").empty().append('Error');
jQuery("#c_response")
.css({"color":"#ffffff","background":"red"})
.show(2000)
.delay(2500)
.hide(2000)
.delay(1000)
.function(function() {
jQuery("#c_input_submit").removeAttr('disabled');
});当我发送表单时,我得到禁用提交按钮,但当end form no再次启用该按钮时,我不知道脚本中有什么不好
借此,我提出这个问题是为了得到一些帮助,谢谢和问候。
发布于 2015-10-01 13:29:37
有了delay函数,你可以使用回调启用按钮
jQuery("#c_input_submit").attr('disabled', 'disabled');
jQuery("#c_response").empty().append('Error');
jQuery("#c_response")
.css({
"color": "#ffffff",
"background": "red"
})
.show(2000)
.delay(2500)
.hide(2000)
.delay(1000,function () {
jQuery("#c_input_submit").removeAttr('disabled');
});JsFiddle
https://stackoverflow.com/questions/32879699
复制相似问题