weimingxin

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\');
});
发表于 2017-12-24 14:38  幽默是一种心情  阅读(75792)  评论(0编辑  收藏  举报
 

分类:

技术点:

相关文章: