码迷,mamicode.com
首页 > 移动开发 > 详细

鼠标移动到图片上切换到另一张图片,移出时又切回来

时间:2016-07-13 22:51:37      阅读:123      评论:0      收藏:0      [点我收藏+]

标签:

HTML写法:

<img id="addLineImg" src="pages/annotator/claim/img/plus.png"
                             onmouseover="this.src=‘pages/annotator/claim/img/plus2.png‘;"
                             onmouseout="this.src=‘pages/annotator/claim/img/plus.png‘;"/>

JS写法:

    var img=document.createElement("img");
    img.setAttribute("src","pages/annottor/claim/img/trash.png");
    img.setAttribute("onclick","removeOneWorkitemLine(this);");
    img.setAttribute("onmouseover","this.src=\"pages/annottor/claim/img/trash2.png\";");
    img.setAttribute("onmouseout","this.src=\"pages/annottor/claim/img/trash.png\";");

 

鼠标移动到图片上切换到另一张图片,移出时又切回来

标签:

原文地址:http://www.cnblogs.com/xiandedanteng/p/5667821.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!