This article mainly introduces how to trigger mouseout with the mouse option in IE, and analyzes the window when the mouse moves to option in IE. event. the reason for toElement return value being null and its solution are as follows. Share it with you for your reference. The specific analysis is as follows:
Functions to be implemented:
There is a DIV. When the mouse passes, the DIV is fully expanded. When the mouse moves away, the DIV is shrunk back. The DIV contains a select box;
When the select operation is performed, a problem occurs in IE. When the mouse passes the option operation, the DIV will contract back, but this phenomenon is not found in other browsers.
Solution:
In IE, when the mouse moves to option, the value of window. event. toElement is null, and the value in other browsers is object;
When you move the cursor directly from the DIV, the value of window. event. toElement is object, and that of other browsers is also;
To sum up, you can add the following code in mouseout to solve the problem:
If (window. event. toElement = null) return;
I hope this article will help you design javascript programs.