CSS的onmouseover 和onmouseout事件


td {
 text-align: center;
 line-height: 30px;
 cursor: hand;
 color:#027CD1;
 /*設置onmouseover事件*/
 onmouseover: expression(onmouseover=function (){
 this.style.borderColor='';
 this.style.backgroundColor='#E5EFF9';
 this.style.color='#000';
 });

 /*設置onmouseout事件*/
 onmouseout: expression(onmouseout=function (){
 this.style.borderColor='';
 this.style.color='';
 this.style.backgroundColor=''});
}

這里也可以引申為this.style.backgroundImage='',

 

$("input[class='buttoncss']").each(function(){
        $(this).mouseover(function(){
            $(this).css("backgroundImage","url(<%=path%>/image/buttonBG/btnBG.png)");
        });
        $(this).mouseout(function(){
            $(this).css("backgroundImage","url(<%=path%>/image/buttonBG/btnBG2.png)");
        });
    });

.buttoncss {
 font-family: "tahoma", "宋體";
 font-size:9pt; color: #444444;
 cursor:pointer;
 background-image:url(<%=path%>/image/buttonBG/btnBG2.png);
 font-style: normal ;
 height:25px;
 margin-bottom:4px;
 width:85px;
 border:0px;
}

 

 

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM