如何实现经过按钮时,按钮背景发生切换!

wdmcsoft 2008-11-26 01:30:13
如何实现经过按钮时,按钮背景发生切换!

可以看一下这个例子:
http://searchjob.chinahr.com/Index.aspx?typeid=Hot###

里面有个立即搜索和清空.
...全文
131 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
小布 2008-11-26
  • 打赏
  • 举报
回复
mouseover和mouseout
layers2323 2008-11-26
  • 打赏
  • 举报
回复
mouseover和mouseout两个触发事件来改变按钮的css。
mrshelly 2008-11-26
  • 打赏
  • 举报
回复
还可以用 link 的 hover 来实现.




<style>
a {
display:table;
width:69px;
height:28px;
background-image: url(http://st.mychinahr.com/a/sjob6.0/style/image/btn_ind.gif);
background-repeat: no-repeat;
cursor: hand;
}

a:hover {
background-position: 0px -28px;
}

</style>

<div>
<a href="#"></a>
</div>

Dogfish 2008-11-26
  • 打赏
  • 举报
回复
使用mouseover和mouseout实现。
mrwang2000 2008-11-26
  • 打赏
  • 举报
回复
【个人意见,仅供参考】
试一试这个

<input type="submit" style="background:url(http://www.baidu.com/img/baidu_logo.gif) no-repeat;width:270;height:129;text-align:center;vertical-align:middle;"
onmouseover="javascript:this.style.backgroundImage='url(http://www.baidu.com/img/baidu_logo.gif)'"
onmouseout="javascript:this.style.backgroundImage=''"
value="试一试"/>
airsiao 2008-11-26
  • 打赏
  • 举报
回复
用js
在按钮上写:onMouseOver 和 onMouseOut
然后分别调用JS的鼠标移入移出
示例:
<input type="submit" name="button" onMouseOver="overimg()" onMouseOut="outimg()" id="button" value="提交" />

<script language="JavaScript">
function overimg(){
document.getElementById("button").style.backgroundColor='#FFFFFF';
}
function outimg(){
document.getElementById("button").style.backgroundColor='#000000';
}
</script>

不太标准规范,是这个意思
cnchart 2008-11-26
  • 打赏
  • 举报
回复
<style type="text/css">
.inp_L1{
background:url(http://mimg.126.com/index/bg_x.jpg) no-repeat;
width:82px;
height:24px;
background-position:-4px -55px;
border:0;
color:#464646;
line-height:23px;
float: none;
text-align: center;
vertical-align: middle;
}
.inp_L2{
background:url(http://mimg.126.com/index/bg_x.jpg) no-repeat;
width:82px;
height:24px;
background-position:-4px -80px;
border:0;
color:#464646;
line-height:23px;
float: none;
text-align: center;
vertical-align: middle;
}

</style>
<input type="submit" value=" 登 录" class="inp_L1" onMouseOver="this.className='inp_L2'" onMouseOut="this.className='inp_L1'" id="input_btn1" name="enter" tabindex="4" />

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧