我有一个帮助弹出窗口,我想关闭其他地方点击。这里是我有什么:如何绑定一个JQuery事件使其仅触发一次?
$('.help[data-info]').click(function(){
$('.info[a complicated selector]').toggle(400);
$('*:not(.info[the complicated selector]).one('click','',function(){
.info[the complicated selector].hide(400);
});
})
但是一()不是我想在它为页面上的每个元素触发之前。我只想让它射击一次。
您在第3个选择器中缺少'''。也是''''one()'的第二个参数? – kubetz