通过更改按钮的显示样式,来实现按钮动态滑动 复制代码 代码如下: 无标题文档 <br><br>.search{ background:#008800; color:#fff; border:none; height:26px; line-height:20px; width:63x;} <BR>.searchhover{background:#000099; color:#fff; border:none; height:26px; line-height:20px; width:63px; } <BR> <br><br>function js() <BR>{ <BR>// 使ie6 button支持hover属性 obj是要支持hover的实体 hover是btn:hover的样式,init是初始样式 <BR>obj="btn"; <BR>alert(navigator.appName); <BR>if(navigator.appName == "Microsoft Internet Explorer" && parseFloat(navigator.appVersion) == 4){// 判断ie6 <BR>var o = document.getElementsByName(obj); <BR>for(var i=0;i<o.length;i++){ <BR>if(o[i].type == "button"){ <BR>//o[i].className = "search"; <BR>o[i].onmouseover = function(){ this.className = "searchhover"} <BR>o[i].onmouseout = function(){ this.className = "search"}; <BR>} <BR>} <BR>} <BR>} <BR>