PDA

View Full Version : Class Change in IE6 (Solved)



michaelc
5 Jan 2011, 10:30 AM
I have a class that based on an action I wish to change for another class.


.login-panel
{
width: 502px;
height: 289px;
background: transparent url("./images/loginbg.png") no-repeat;
padding-left: 28px;
font-family: Arial,Helvetica,sans-serif;
font-size: 12px;
font-weight: bold;
color: #515354;
visibility: hidden;
}

.login-panel-large
{
width: 515px;
height: 440px;
background: transparent url("./images/loginbg-large.png") no-repeat;
padding-left: 28px;
font-family: Arial,Helvetica,sans-serif;
font-size: 12px;
font-weight: bold;
color: #515354;
visibility: hidden;
}
So I try this
document.getElementById("alflogin").setAttribute("class"."login-panel-large yui-module yui-overlay");

works like a champ in all but IE6, I tried a few other methods and all failed to give me the result I wanted in IE6.
I wanted a change in the background image and it's size.

any ideas ?
I can change to two forms and hide/show the forms, but it just seems that this should work.

<kvetch> gwad do I hate IE6, I must waste about 20% of my code time just making stuff work in it, would you IT folks move your butts and change everyone over to Windows 7. </kvetch>

michaelc
5 Jan 2011, 11:49 AM
Solved, just need to step back for a minute.
Use the larger of the images in both styles and then add Overflow: hidden.

This will then clip the image to the box size.
Not as elegant as I wanted, but very functional.