84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
之所以用focusin(),是因为他支持父元素上检测子元素失去焦点的情况。 一个一个移除太麻烦了。
闭关修行中......
使用 off 解绑就可以。
target.off('focusin');
示例:http://jsfiddle.net/UUPHq/
<input id="test" placeholder="点我"/> <span id="console"></span>
var target = $('#test'); var console = $('#console'); target.focusin(function() { console.text('focusin'); }); target.focusout(function() { console.text('focusout'); target.off('focusin'); });
使用 off 解绑就可以。
示例:http://jsfiddle.net/UUPHq/