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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Netscape runs only once OnMouseOut event ??

Status
Not open for further replies.

hablablow

Programmer
Sep 9, 2000
115
FR
Hello,
I use several times on a page two animated gifs.
The first appears OnMouseOver, second OnMouseOut.
Ie handles this as many times as you pass your mouse over and out.
1) Netscape handles the over event same but only ONCE the mouse out.
Usually u use the mouseout event to return to your original img. I want another animated img to appear. Works only once ?!
Is there a function i can use to avoid OnMouseOut to run only once ?

Here is the script i use:
<SCRIPT LANGUAGE=&quot;javascript&quot;>
<!-- Hide from old browsers
var logo1=new Image();
logo1.src=&quot;webdesign/logo1_roll.gif&quot;;
var nlogo1=new Image ();
nlogo1.src=&quot;webdesign/logo1_roll_xx.gif&quot;;

var logo2=new Image();
logo2.src=&quot;webdesign/logo11_roll.gif&quot;;
var nlogo2=new Image ();
nlogo2.src=&quot;webdesign/logo11_roll_xx.gif&quot;;

function fnSwapNumber(type){
if (type==1){
document.images['logo1'].src=logo1.src;
}
else{
document.images['logo1'].src=nlogo1.src;
}
}
function fnSwapNumberTwo(type){
if (type==1)
document.images['logo2'].src=logo2.src;
}
else{
document.images['logo2'].src=nlogo2.src;
}
}
//-->
</SCRIPT>
<BODY>
<TABLE CELLPADDING=&quot;0&quot; CELLSPACING=&quot;0&quot;>
<TR>
<TD><A HREF=&quot;javascript:void(0)&quot;
ONMOUSEOVER=&quot;fnSwapNumber(1);window.status=' '; return true;&quot;
ONMOUSEOUT=&quot;fnSwapNumber(0);window.status=' '; return false;&quot;
onClick=&quot;return false;&quot;> <IMG SRC=&quot;webdesign/logo1.gif&quot; NAME=&quot;logo1&quot; BORDER=&quot;0&quot; ONLOAD=&quot;&quot; WIDTH=&quot;73&quot; HEIGHT=&quot;73&quot;></A></TD>

<TD><A HREF=&quot;javascript:void(0)&quot;
ONMOUSEOVER=&quot;fnSwapNumberTwo(1);window.status=' '; return true;&quot;
ONMOUSEOUT=&quot;fnSwapNumberTwo(0);window.status=' '; return false;&quot;
onClick=&quot;return false;&quot;>

2) Consider that you have 2 same animated gifs on and out. Ie will handle them separatly: you can start 1 then 2 they will animate separately. On Netscape when you start 1 then 2 they will be synchronized, automatically animate on the same frame ?!
Can you use a function to avoid this ?

Thank you for your help and incomming posts.
Hablablow.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top