Jul 26, 2008

First Defeat

Free Web Hosting, No Ads > CONTRIBUTE > Computers > Programming Languages > Java, Java Servlets, Java Script, & JSP

free web hosting

First Defeat

kvarnerexpress
I have 3 images that change to short animated gif's onmouseover and into a second animated gif onmouseout...

This works fine in ie but in firefox all the three images change to the "out animation" onmouseout


Code:
CODE
if (document.images) {
a2alpha = new Image();
alpha2a = new Image();
a2alpha.src = "graphics/a2alpha.gif";
alpha2a.src = "graphics/alpha2a.gif";
}
else {
a2alpha.src = "";
alpha2a.src = "";
}
function animate(arrow) {
document.getElementById('arrow' + arrow).src = a2alpha.src;
}
function deanimate(arrow) {
document.getElementById('arrow' + arrow).src = alpha2a.src;
}

....

<img src="graphics/arrow.gif" class="arrow" id="arrow1" style="top: 201px;">
<img src="graphics/spacer.gif" class="boverlay" style="top: 190px;" onmouseover="active('1'); animate('1');" onmouseout="deactive('1'); deanimate('1');">
<img src="graphics/arrow.gif" class="arrow" id="arrow2" style="top: 273px;">
<img src="graphics/spacer.gif" class="boverlay" style="top: 262px;" onmouseover="active('2'); animate('2');" onmouseout="deactive('2'); deanimate('2');">
<img src="graphics/arrow.gif" class="arrow" id="arrow3" style="top: 345px;">
<img src="graphics/spacer.gif" class="boverlay" style="top: 334px;" onmouseover="active('3'); animate('3');" onmouseout="deactive('3'); deanimate('3');">

I have noticed that, in firefox, it works fine the first time the function is called and the second time it then changes both the new "arrow" and the old one.

Is this a common firefox problem that i have missed?

All help is appreciated

Kvarnerexpress

Notice from snlildude87:
All code goes in the [code] BBCode tags. Thank you.

 

 

 


Reply

snlildude87
Hmm, in Firefox, go to Tools -> Options... -> Web Features -> make sure the JavaScript checkbox is checked -> Advanced ... -> make sure Change Images at the bottom is checked.

If that doesn't work, try reading my post about rollover images, and see if you can try to incorporate it into your page. smile.gif

Feel free to PM me or post a reply if it doesn't work out!

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Similar Topics

Keywords : defeat


    Looking for defeat

Searching Video's for defeat
advertisement



First Defeat



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE