随笔分类 -  jquery

jquery
摘要:$(".btn1").click(function(){ $("#box").animate({height:"300px"});});定义和用法animate() 方法执行 CSS 属性集的自定义动画。该方法通过CSS样式将元素从一个状态改变为另一个状态。CSS属性值是逐渐改变的,这样就可以创建动画效果。只有数字值可创建动画(比如 "margin:30px")。字符串值无法创建动画(比如 "background-color:red")。注释:使用 "+=" 或 " 阅读全文
posted @ 2012-01-11 17:16 枫- 阅读(550) 评论(0) 推荐(0)
摘要:起初以为this和$(this)就是一模子刻出来。但是我在阅读时,和coding时发现,总不是一回事。What is "this"?In many object-oriented programming languages, this (or self) is a keyword which can be used in instance methods to refer to the object on which the currently executing method has been invoked.$("#textbox").hover( 阅读全文
posted @ 2012-01-10 18:26 枫- 阅读(278) 评论(0) 推荐(0)
摘要:1:判断radiovar selected = $('input[name=selectid:checked]').val();//若未被选中 则val() = null if(selected == null){ alert("未选中!"); }else{ alert("选中!"); }2:判断checkbox var n = $("input:checked").length; if(n==0){ alert("未选中!"); }else{ alert("选中!"); } $ 阅读全文
posted @ 2011-11-07 10:06 枫- 阅读(186) 评论(0) 推荐(0)