我正在嘗試使用onblur事件來關閉一個窗口。它在IE,Firefox和Safari瀏覽器中工作正常,但事件不會在Chrome中觸發。是一個錯誤在鉻或從我的錯誤onblur event not working with google chrome
回答
我意識到這是一年前,但它顯示了我在谷歌,同時試圖解決同樣的問題。
看來Chrome並沒有考慮到一些元素,比如身體和錨點,都是「可以聚焦」的。根據下面的頁面,你可以做任何可獲得焦點的元素通過設置的tabindex屬性(從而激活模糊事件):http://www.quirksmode.org/dom/events/blurfocus.html
像這樣:
<a href="#" tabindex="0" onblur="alert('blur')"> blur me </a>
一個好的解決方案,但似乎不適用於'button'元素。 – tagawa 2013-05-17 03:14:44
鉻接受onblur事件。我有什麼經驗是...檢查或取消勾選複選框,鉻不關注它。
添加屬性
onclick="this.focus()" onblur="yourMethod()"/>
你會看到它正常工作即可。
恰好碰到了這個問題...
的onblur(大寫 「B」)不工作,但的onblur(小寫字母 「B」)一樣。去搞清楚! ; -/
語言中沒有任何東西表明它不是小寫字母。 – 2013-06-06 04:58:15
好吧,是的!除了這個以外,一切都是相關的! – 2013-08-12 15:35:11
- 1. Angular JS onblur event not working on chrome
- 2. jquery click event not working with children
- 3. onblur event not firing
- 4. Google Signin with IE11&Edge not working
- 5. text_changed event not working
- 6. select event not working
- 7. onchange event not fire in google chrome
- 8. ng-click event not working
- 9. position:fixed not working in Google Chrome
- 10. preventupfault()on keyup event not working
- 11. html5 autofocus not working with google maps v3 infowindow form
- 12. onmouseover with ajax not working
- 13. jquery scrollTop event on mobile not working
- 14. phonegap offline/online event not working
- 15. Fusion Tables fusiontips mouseover event not working
- 16. textbox keyup event not working properly
- 17. Datagridview cellcontent click event not working properly
- 18. JComboBox KeyReleased event does not working
- 19. jquery change event not working in coffeescript
- 20. MouseListener event not working in Java
- 21. Android Studio'Device Only'Location with Google Play Services not working
- 22. SyntaxHighlighter with $()。load Not Working
- 23. wait_for with ansible not working
- 24. jquery selector not working with []
- 25. NSPredicate With FUNCTION Not Working
- 26. String.replaceOccurrences(of :) with :) not working?
- 27. ImageResizing with s3reader not working
- 28. jquery to ashx not working event not fired
- 29. jqueryui button click not working with url.action
- 30. jquery mousewheel event only working on Chrome
你想使用window.onBlur嗎?你能否提供一個代碼示例 - 那麼每個人都更容易幫助你。 – Kinlan 2010-04-09 12:07:38
我遇到了同樣的問題。 – NLV 2010-07-31 12:40:34
你真的應該爲你的問題添加一個代碼示例 – Black 2016-04-08 11:54:00