why it makes ie6 or ie8 compatible mode crash
Posted
by
hylin
on Stack Overflow
See other posts from Stack Overflow
or by hylin
Published on 2012-09-13T03:37:05Z
Indexed on
2012/09/13
3:38 UTC
Read the original article
Hit count: 183
Anybody can tell me why those code can make ie6 or ie8 compatible mode crash? PS:I know,there is so many ways to avoid this satuation, but I just want to know why. To avoid:
- Change class="wrapper"-->class="wrapper2" or other != "wrapper"
- $('wrapper').style.overflow='visible'; --> setTimeout(function(){$('wrapper').style.overflow='visible';},10);
- Or remove any style , js operation...
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <style>.wrapper{width:975px;margin:60px auto 0}</style> </head> <body id="wrapper" style="overflow:hidden;"> <div id="overlay" style="position:absolute;"></div> <div class="wrapper"> <input type="text" id="input1"/> <a id="btn" href="javascript:;">test</a> </div> <script type="text/javascript"> $('btn').onclick = function(){ $('overlay').style.display='none'; $('wrapper').style.overflow='visible';
$("input1").focus(); }
function $(s){ return document.getElementById(s);
} </script> </body> </html>
© Stack Overflow or respective owner