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>

posted on 2013-12-19 16:02  都是脚本惹的祸  阅读(304)  评论(0编辑  收藏  举报

导航