[英]Why isn't my rollover image working?
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>
使用CSS精灵进行过渡。
Your HTML is invalid. 您的HTML无效。
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
相同...
onMouseOut="this.src='http://japanesefriend.zxq.net/images/level4_nouns_08.gif'"
DEMO: http://jsfiddle.net/XBLfN/ 演示: http : //jsfiddle.net/XBLfN/
Or you can eliminate this.
或者您可以消除this.
and just do src='http://...
只是做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/ 演示: http : //jsfiddle.net/XBLfN/1/
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/ 对于chrome(甚至对于其他浏览器),验证HTML始终是一个好主意: http : //validator.w3.org/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.