tomyknoker
06-24-2003, 10:25 PM
Hi Everyone,
I have this code (below), it is just a simple rollover change from one image to the other. Just wondering what I would do if I want to have it so when the user rolls over with the mouse as well as the image changing another images is visible next to the button as well. So in summary when rollover happened on the button it changed and also turns on another seperate image??
thanks in advance,
Tom
<HTML>
<HEAD>
<TITLE>Buttons</TITLE>
</HEAD>
<SCRIPT language="JavaScript">
<!-- Hide from older browsers
var home1 = new Image(250, 100);
home1.src = "images/home1.gif";
var home2 = new Image(250, 100);
home2.src = "images/home2.gif";
function change(imageName, imagesrc) {
document.images[imageName].src = imagesrc.src;
}
// Stop Hiding -->
</SCRIPT>
<BODY>
<A HREF="#" onMouseover="change('home', home2);"onMouseout="change('home', home1);"><IMG name="home" src="images/home1.gif" width="250" height="100" border="0"></A>
</BODY>
</HTML>
I have this code (below), it is just a simple rollover change from one image to the other. Just wondering what I would do if I want to have it so when the user rolls over with the mouse as well as the image changing another images is visible next to the button as well. So in summary when rollover happened on the button it changed and also turns on another seperate image??
thanks in advance,
Tom
<HTML>
<HEAD>
<TITLE>Buttons</TITLE>
</HEAD>
<SCRIPT language="JavaScript">
<!-- Hide from older browsers
var home1 = new Image(250, 100);
home1.src = "images/home1.gif";
var home2 = new Image(250, 100);
home2.src = "images/home2.gif";
function change(imageName, imagesrc) {
document.images[imageName].src = imagesrc.src;
}
// Stop Hiding -->
</SCRIPT>
<BODY>
<A HREF="#" onMouseover="change('home', home2);"onMouseout="change('home', home1);"><IMG name="home" src="images/home1.gif" width="250" height="100" border="0"></A>
</BODY>
</HTML>