Why isn't my rollover image working?

708 views Asked by At

I have a code for my site, when an image is clicked a pop up window displays which is working fine. However, whenever I roll over the first rollover works, but the original image before the rollover does not show anymore? why is this?

 <input name="image" type="image" onMouseOver= src="http://japanesefriend.zxq.net/images/x11_title.gif" onMouseOut= src="http://japanesefriend.zxq.net/images/level4_nouns_08.gif'"  value="Place Order" src="http://japanesefriend.zxq.net/images/level4_nouns_08.gif" onClick='styledPopupOpen("<img src=http://japanesefriend.zxq.net/flashcards/go.gif />")'  align=middle width=164 height=154>
3

There are 3 answers

0
Vijay Agrawal On BEST ANSWER

see: rollover image with buttons

this seems to be a duplicate - the solution in the above question shoudl work for you.

For chrome (and even for other browsers), it is always a good idea to validate your html: http://validator.w3.org/

0
Marat Tanalin On

Use CSS sprites for rollovers.

1
AudioBubble On

Your HTML is invalid.

This...

onMouseOver= src="http://japanesefriend.zxq.net/images/x11_title.gif"

should be this...

onMouseOver="this.src='http://japanesefriend.zxq.net/images/x11_title.gif'"

Same for the onMouseOut...

onMouseOut="this.src='http://japanesefriend.zxq.net/images/level4_nouns_08.gif'"

DEMO: http://jsfiddle.net/XBLfN/


Or you can eliminate this. and just do src='http://...

onMouseOver="src='http://japanesefriend.zxq.net/images/x11_title.gif'"
onMouseOut="src='http://japanesefriend.zxq.net/images/level4_nouns_08.gif'"

DEMO: http://jsfiddle.net/XBLfN/1/