I have this simple script to preload a rollover button graphic and change buttons on mouseover. This is a submit button for a form. As you can see it's in
XHTML.
- Code: Select all
<head>
<script type="text/javascript">
<![CDATA[
pic1= new Image(54,54);
pic1.src="./images/submit3_over.gif";
pic2 = new Image(54, 54);
pic2.src"./images/submit3.gif";
]]>
</script>
</head>
<body>
form here
<div class="tac">
<input type="submit" class="submitd2" name="go" value=" "
onmouseover="this.className='submite2'"
onmouseout="this.className='submitd2'" />
end form
</div><div class="clear"></div>
The
css is:
- Code: Select all
.submitd2 {
height: 54px;
width: 54px;
margin: 0 0 0 45px;
float: left;
position: relative;
top: -9px;
background: #becbcc url(./images/submit3.gif);
border-width: 0;
}
.submite2 {
height: 54px;
width: 54px;
margin: 0 0 0 45px;
float: left;
position: relative;
top: -9px;
background: #becbcc url(./images/submit3_over.gif);
border-width: 0;
}
This works flawlessly in Firefox. In IE7, however, the rollover is balky and I don't get the image for a half second after rollover or mouseout. Not just the first time either -- I get a brown box grapic and a slow response, where neither image is present.
Any ideas?
P.S. The image has to be in the background because this is a submit button, not an <a> link.
Here's a link if you want to see it. Try it in IE7.
http://www.dhreport.com/test_interactive/ezform.php