jquery 操作滚动条滚动 animate checkbox操作

if ($("#chkchannel").length > 0 && $("#chkchannel")[0].checked) {
Alert('checned');
}

<html>
<head>
<script type="text/javascript" src="/jquery/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function()
  {
  $(".btn1").click(function(){
    if(!$("#box").is(":animated")){
     $("#comtent").animate({height : "+=50"});
  } else {
alert("ddd");
}
   
  });
  $(".btn2").click(function(){
    //$("#comtent").animate({height : "-=50"});
    $("#comtent").css({height : "-=50"});
  });


  $("#test1").click(function(){
  $("#comtent").animate({scrollTop: "+=17"});
$("[name='item']:checkbox").attr("checked",true);
});


  $("#test2").click(function(){
    $("#comtent").animate({scrollTop: "-=17"});
$("[name='item']:checkbox").attr("checked",false);
});


$("#change").click(function(){
 $("[name='item']:checkbox").each(function(){
  this.checked = !this.checked;
});
});
});
</script>
</head>
<body>
<textarea id="comtent" cols="10" rows="8">
向程序员的知识分享与学习社区。不允许发布任何推广、广告、政治方面的内容,不允许把博客当作SEO工具。
博客园首页是分享原创精品博文的地方,是最受关注的地方,也是被严格管理的地方。博客园首页是指网站首页,不是您的个人博客首页。
如果发到博客园首页,请一定要认真对待,多花一些工夫,拿出您的精品,让读者有真正的收获,您也会有很多收获!
如果博文不符合博客园首页质量要求,会被工作人员移出首页,望理解。
如有疑问,请联系contact@cnbl
</textarea>
<button class="btn1">Animate</button>
<button class="btn2">Reset</button>


<button id="test1">next</button>
<button id="test2">prev</button>
<button id="change">反选</button>


<input type="checkbox" name="item"/>
<input type="checkbox" name="item"/>
</body>
</html>

转载于:https://www.cnblogs.com/lccnblog/p/3482380.html

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值