如何解决blur事件与click事件冲突
如果在标签上绑定blur事件,很有可能在click其他标签时,造成click事件没有被触发,原因是因为blur事件先于click事件触发而造成click事件失效。解决方案是blur事件加一个延迟效果;
1 $("input").on('blur',function(){ 2 setTimeout(function () { 3 //do something 4 },100);//延迟100ms 5 });
==================================
I'm not just a coder
keep running,keep fighting...
==================================
I'm not just a coder
keep running,keep fighting...
==================================