我想在mouseover
和mouseout
我的代码:
<img src="convert.php?file=image.gif" title="Preview image"
width="100" height="100" rel="image.gif"
onmouseover="this.src=this.rel"
onmouseout="this.src='convert.php?file='+this.rel" />
this.rel
获取undefined
。请检查并帮助我。 :(
答案 0 :(得分:2)
<img src="convert.php?file=image.gif" title="Preview image"
width="100" height="100" rel="image.gif"
onmouseover="this.src=this.getAttribute('rel')"
onmouseout="this.src='convert.php?file='+this.getAttribute('rel')" />