문제

In Internet Explorer 7 and 8, but not in 9 and newer, clicking on a div which contains an image on a website, triggers the window.blur event. But this is wrong.

However, this is very disfunctional, because we use this method to find out if the user leaves the website (focus is on another window).

Any idea on how to workaround this problem?

도움이 되었습니까?

해결책

I solved the problem by checking document.hasFocus() as a first thing in the window.blur callback. If it gets triggered wrongly, at least the document does still has focus.

The problem was probably due to using HTML 5 tags such as article and section which confused the old IEs.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top