At work we use this tool called NiftyCube to round corners of elements (it even works with divs that have gradients in them). The problem, however, is that on Internet Explorer 8, 100% width divs are shrunk to the contents of the div.
That happens because NiftyCube has code to correct rendering problems in previous version of IE. Since IE 8 renders more elements correctly, NiftyCube’s hack actually makes things worse in IE 8. To fix the problem, disable their fix for IE 8. Apply this change to niftycube.js:
Index: tuber/trunk/common/web/htdocs/assets/js/niftycube.js =================================================================== --- a/tuber/trunk/common/web/htdocs/assets/js/niftycube.js +++ b/tuber/trunk/common/web/htdocs/assets/js/niftycube.js @@ -156,7 +156,22 @@ } +function getIeVersion() { + var rv = -1; + if (navigator.appName == 'Microsoft Internet Explorer') { + var ua = navigator.userAgent; + var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})"); + if (re.exec(ua) != null) { + rv = parseFloat(RegExp.$1); + } + } + return rv; +} + function FixIE(el){ if(el.currentStyle!=null && el.currentStyle.hasLayout!=null && el.currentStyle.hasLayout==false) - el.style.display="inline-block"; + var ver = getIeVersion(); + if (ver < 8) { + el.style.display="inline-block"; + } }
Works great! Thanks.
Thanks a lot!! Works perfect
You are a legend! This has been causing me problems, since I use this script on our back end system. It has been driving me up the wall! Thank you, thank you, thank you!
Your new best friend,
Mongoose.
you’re a genius!!!
Sweet! I’m sure this would have taken me a while to track down. Thank you!
Thanks a lot