【发布时间】:2015-06-25 21:59:11
【问题描述】:
我有一个引导弹出框,它在输入的focus 上变为活动状态。弹出框包含一个用于执行 ajax 请求的按钮。
我有一个blur 函数,如果用户点击离开输入框,它会关闭弹出框:
$(document).on('blur','.open-popover',function(){
$(".popover").attr("style","");
//and do other things too
});
如果用户按下弹出窗口中的按钮,我试图阻止上面的 blur 函数运行:
$(document).on('click','button',function(){
//prevent the blur actions and
//do ajax stuff
});
【问题讨论】:
-
我认为stackoverflow.com/questions/13509484/… 是一个更好的候选人。
标签: javascript jquery