Onmouseover图像与填充

时间:2015-04-21 16:14:36

标签: javascript css

我正在尝试为我的Onmouseover图片添加填充但似乎没有任何效果......原始代码是

<img src='/wp-content/uploads/2015/04/img-white.png' width="40" height="40" onmouseover="this.src='/wp-content/uploads/2015/04/img-green.png'; clicknovosti()" onmouseout="this.src='/wp-content/uploads/2015/04/img-white.png';">

我为不清楚而道歉,我只是想将填充添加到绿色版本,添加到悬停图像

有人可以提供帮助吗?非常感谢

1 个答案:

答案 0 :(得分:1)

<img src='/wp-content/uploads/2015/04/img-white.png' width="40" height="40" onmouseover="this.src='/wp-content/uploads/2015/04/img-green.png'; this.style.padding='10px'" onmouseout="this.src='/wp-content/uploads/2015/04/img-white.png';this.style.padding='0px'">

这将给出填充。