当鼠标经过时,如何更改button的背景图片

来源:百度知道 编辑:UC知道 时间:2024/05/30 21:28:39
当鼠标经过时,如何更改button的背景图片
<script language="javascript">
for(var i=0; i<10; i++)
{
document.write("<tr>");
document.write('<td ><input type="button" id="BigPlay" value="" style="background:url(../preview_icon.gif); border-style:none; width:24px; height:21px; background-repeat:no-repeat;" onclick="ChangeIMG(this)"/></a></td>');
document.write("</tr>");
}
function ChangeIMG(obj)
{
obj.style="background:url(../preview_icon_move.gif); border-style:none; width:24px; height:21px; background-repeat:no-repeat;";
}
请问ChangeIMG函数要怎么写呢?

没这么复杂吧

<ONMOUSEOVER="changeImages('more_06', 'images/more_06-Over.gif'); return true;"
ONMOUSEOUT="changeImages('more_06', 'images/more_06.gif'); return true;">
<IMG NAME="more_06" SRC="images/more_06.gif" WIDTH=112 HEIGHT=55 BORDER=0 ALT="">
也可以用ImageReady自动生成