84669 人學習
152542 人學習
20005 人學習
5487 人學習
7821 人學習
359900 人學習
3350 人學習
180660 人學習
48569 人學習
18603 人學習
40936 人學習
1549 人學習
1183 人學習
32909 人學習
之所以用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/