jquery 移除border_jquery 操作css 类 (新增和删除)

表格奇偶行数 显示不同的class 并设置mouseover 的add class发光属性

$(document).ready(function(){

$(".table tr").mouseover(function(){

$(this).addClass("odd");

}).mouseout(function(){ $(this).removeClass("odd");//移除该行的class });

$(".table tr:even").addClass("even");   //tr:even 是代表表格里的偶数行

});

jQuery 操作 CSS

jQuery 拥有若干进行 CSS 操作的方法。我们将学习下面这些:

addClass() - 向被选元素添加一个或多个类

removeClass() - 从被选元素删除一个或多个类

toggleClass() - 对被选元素进行添加/删除类的切换操作

css() - 设置或返回样式属性

jQuery 尺寸 方法

jQuery 提供多个处理尺寸的重要方法:

width()

height()

innerWidth()

innerHeight()

outerWidth()

outerHeight()

其中 : outerWidth() = width(100) + padding(10*2) + border(1*2) = 122

outerWidth(true) = width(100) + padding(10*2) + border(1*2)+ margin(5*2)  = 122

innerHeight() = width(100) - padding(10*2) - border(1*2)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值