aspnetguy Posted January 9, 2006 Share Posted January 9, 2006 I found a bug in IEI tried using setAttribute("style", cssStyles);and it does not work in IE. So I had to use the ugly work around like this var theDiv = document.createElement('div'); theDiv.setAttribute('id','cropArea'); imgParent.appendChild(theDiv); var cropAreaDiv = document.getElementById('cropArea'); cropAreaDiv.style.border = '1px dashed #000'; cropAreaDiv.style.background = '#dedede'; cropAreaDiv.style.filter = 'alpha(opacity=50)'; cropAreaDiv.style.position = 'absolute'; cropAreaDiv.style.top = y1.value + 'px'; cropAreaDiv.style.left = x1.value + 'px'; cropAreaDiv.style.width = dw + 'px'; cropAreaDiv.style.height = dh + 'px'; instead of just 2 lines like this var cssStyle = "..the styles...";theDiv.setAttribute("style", cssStyles); Man I hate IE. Is there a cleaner work around???Thanks. Link to comment Share on other sites More sharing options...
Jonas Posted January 9, 2006 Share Posted January 9, 2006 IE sucks! Link to comment Share on other sites More sharing options...
aspnetguy Posted January 9, 2006 Author Share Posted January 9, 2006 Thanks Jonas...I appreciate your sympathy...lol Link to comment Share on other sites More sharing options...
Jonas Posted January 9, 2006 Share Posted January 9, 2006 Heh, what else can I say? I can't help you otherwise. Someone needed to say it... Link to comment Share on other sites More sharing options...
aspnetguy Posted January 9, 2006 Author Share Posted January 9, 2006 I suppose so Link to comment Share on other sites More sharing options...
Skemcin Posted January 9, 2006 Share Posted January 9, 2006 it's not a bug, its a feature - gosh, when are you guys gonna get it right. Link to comment Share on other sites More sharing options...
Jonas Posted January 9, 2006 Share Posted January 9, 2006 If it's not a bug, it must be a lack of a feature, doesn't it?Anyway, we're not helping, sorry. Anyone? Link to comment Share on other sites More sharing options...
aspnetguy Posted January 9, 2006 Author Share Posted January 9, 2006 Isn't it a bug in the feature? IE says it supports setAttribute but htis attribute doesn't work. Link to comment Share on other sites More sharing options...
hacknsack Posted January 10, 2006 Share Posted January 10, 2006 You fellows are funny..And I thought the "O" was for Opera Maybe this will help with the problem, <html> <head> <title></title> <script type="text/javascript"> function mkDiv(){ var cssStyle = "position: absolute; top: 150px; left: 50px;"; if(window.ActiveXObject){ var nDiv = document.createElement('<div style="' + cssStyle + '">'); } else { var nDiv = document.createElement('DIV'); nDiv.setAttribute('style', cssStyle); } var nText = document.createTextNode('This is our new div'); nDiv.appendChild(nText); document.getElementById('holder').appendChild(nDiv); } window.onload = mkDiv; </script> </head> <body> <div id="holder"> </div> </body></html> Please join: FFSCIE(Folks For Standards Compliant IE) Link to comment Share on other sites More sharing options...
aspnetguy Posted January 27, 2006 Author Share Posted January 27, 2006 hey thanks that is a good idea Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now