最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to remove jQuery .focusOut function - Stack Overflow

programmeradmin1浏览0评论

I have an element that has focusOut event apilied to it:

$('selector').focusout(function() {           
});

later i need that function removed. I tried:

$('selector').off('focusout');

but it doesn't seem to work. Any advices??

(I can't get around this, ive tried i need it removed)

Thx in advance :D

EDIT:

im useing Jquery 1.8.3

Unfortunate i can't provide fidle because I'm useing proprietary framework that has some private html tags and fidle can't read trough it

I have an element that has focusOut event apilied to it:

$('selector').focusout(function() {           
});

later i need that function removed. I tried:

$('selector').off('focusout');

but it doesn't seem to work. Any advices??

(I can't get around this, ive tried i need it removed)

Thx in advance :D

EDIT:

im useing Jquery 1.8.3

Unfortunate i can't provide fidle because I'm useing proprietary framework that has some private html tags and fidle can't read trough it

Share Improve this question edited Sep 11, 2013 at 10:37 Ivan Pavić asked Sep 11, 2013 at 10:23 Ivan PavićIvan Pavić 5385 silver badges23 bronze badges 7
  • Have you tried .stop()? Or . clearQueue()? – Myles Commented Sep 11, 2013 at 10:26
  • 2 Which jquery version are you using? – A. Wolff Commented Sep 11, 2013 at 10:26
  • @Myles .stop() and clearQueue() are not event's method – A. Wolff Commented Sep 11, 2013 at 10:27
  • 1 Could you provide your full code? Possibly a fiddle? – Manishearth Commented Sep 11, 2013 at 10:30
  • event.preventDefault() can help you – Rajarshi Das Commented Sep 11, 2013 at 10:33
 |  Show 2 more ments

3 Answers 3

Reset to default 5

The only way I can re-create your problem is with jquery 1.6.4 or below if you are using this you need to do it like this:

$('selector').bind('focusout', function() {

});

$('selector').unbind('focusout');

Try this

$('selector').unbind('focusout');

Try

$("selector").unbind("focusout");
发布评论

评论列表(0)

  1. 暂无评论