标题:[求助]换背景图片
只看楼主
smofbao
Rank: 1
等 级:新手上路
帖 子:135
专家分:0
注 册:2006-4-5
 问题点数:0 回复次数:2 
[求助]换背景图片

有一个按纽(html)的
按纽是这样做的
<input id="aa" type="button" value="but" onclick="bb()" />
<script language="javascript" type="text/javascript">
bb()
{
aa.style.backgroundImage="url(icn/Arw03lt5.ico)";
aa.style.backgroundPosition="center top";
aa.style.backgroundColor="transparent";
aa.style.backgroundColor="red";
aa.style.display="none";
}
</script>

这样写改变按纽的背景图片,颜色等
在哪有问题。

搜索更多相关主题的帖子: javascript 背景图片 button center 
2007-09-26 15:51
jxnuwy04
Rank: 2
等 级:新手上路
威 望:4
帖 子:768
专家分:0
注 册:2006-9-15
得分:0 
我发现的问题:是不bb()函数前要加function? 其他的不怎么懂就不太清楚了.

------------------不为别的,就为你,我的理想!-----------------
2007-09-26 17:05
smofbao
Rank: 1
等 级:新手上路
帖 子:135
专家分:0
注 册:2006-4-5
得分:0 
function bb()
{
document.getElementById("aa").style.backgroundImage="url(icn/Arw03lt5.ico)";
document.getElementById("aa").style.backgroundPosition="center top";
document.getElementById("aa").style.backgroundColor="transparent";
document.getElementById("aa").style.backgroundColor="red";
document.getElementById("aa").style.display="none";
}
改成这样就行了

2007-09-27 08:41



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-173051-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.264993 second(s), 7 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved