In most cases, hide (set display: none) an element. You do not need to hide all its child elements in sequence. To do this, you may encounter unexpected bugs. As follows:
1, two p, d1 contains d2
Both d1 and d2 have absolute or relative.
3. Hide d1
4. Hide the child element d2.
5. Display d1
At this time, IE6/7 and IE8/9/10 (IE7 mode) will find that the child element d2 can also be displayed (don't forget, d2 is displayed: none ). However, IE8/9/10/Firefox5/Safari4/Chrome12 neutron element d2 is still hidden.
Code Reproduction
The Code is as follows:
IE6/7 and IE8/9/10 (IE7 mode) hides the parent and child elements with absolute or relative in turn, and then displays the parent element. The child element can still display bugs.
1) Hide p [id = d1]
2) Hide p [id = d2]
3) show p [id = d1]
Script
Var d1 = document. getElementById ('d1 ');
Var d2 = document. getElementById ('d2 ');
Function hidden_d1 (){
D1.style. display = "none ";
}
Function hidden_d2 (){
D2.style. display = "none ";
}
Function display_d1 (){
D1.style. display = "block ";
}
Script