jQuery 動態添加、刪除css樣式


1.addClass 

css中:

<style type="text/css">
       .chColor {background: #267cb7;color:white;
     }
   </style>

js中:

$("#nm_p").addClass("chColor"); // 追加樣式

$("#nm_p").removeClass("chColor"); //移除

2.css

  $("#61dh a").hover(
function
(){
     $(this).css('color','#999');
  },
    function(){ 
     $(this).css('color','#123456');
});


免責聲明!

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



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