按钮hover 兼容IE

xiaoxiao2021-02-28  92

.buttonX,.buttonY {     font-size: 12px;     width:60px;     height:20px;     margin:3px 6px;     border: 1px solid #999;     background-color: #ddd;     text-align: center;     color: #000;     cursor: pointer;     event:expression(     onmouseover = function(){         $(this).removeClass("buttonX").addClass("buttonX_over");         },     onmouseout = function(){         /*this.className='buttonX';*/         $(this).removeClass("buttonX_over").addClass("buttonX");         }     ) } .buttonX:hover,.buttonY:hover,.buttonX_over {     font-size: 12px;     width:60px;     height:20px;     margin:3px 6px;     border: 1px solid #777;     background-color: #999;     text-align: center;     color: #ffffff;     cursor: pointer;

}

重点在:

onmouseover = function(){         $(this).removeClass("buttonX").addClass("buttonX_over");         },     onmouseout = function(){         /*this.className='buttonX';*/         $(this).removeClass("buttonX_over").addClass("buttonX");         }

转载请注明原文地址: https://www.6miu.com/read-77864.html

最新回复(0)