Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

event handling

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
ok I am a beginner here....

can anyone tell me what the code would be for making an image into a rollover and changing the window.status??? (both 'on mouseover/ mouseout') I don't know how to get both things to happen when the image is rolled over as I can't find a reference to the syntax for combining 2 things together in this way!!
 
Hi struggling Lisa,

I use this sample to do it :

<html>
<head>
<script language=&quot;javascript&quot;>
<!-- Hiding script from old browsers
if (document.images) {
/*Definitions*/
but1on=new Image();
but1off=new Image();

/*Assignments*/
but1on.src=&quot;image_on.gif&quot;;
but1off.src=&quot;image_off;gif&quot;;
}
function On(imgName) {
if (document.images) {
document
.src = eval(imgName + &quot;on.src&quot;);
}
};
function Off(imgName) {
if (document.images) {
document
.src = eval(imgName + &quot;off.src&quot;);
}
};
//-->
</script>
</head>
<body>
<a href=&quot;myPage.htm&quot; ONMOUSEOVER=&quot;On('but1'); window.status='My comment in the window status';return true&quot; ONMOUSEOUT=&quot;Off('but1'); window.status=' ';return true&quot;><IMG SRC=&quot;image_off.gif&quot; BORDER=&quot;0&quot; NAME=&quot;but1&quot;></a>
<body>
</html>

Hope this helps ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top