jQuery基本过滤选择器
来源:互联网 发布:qq群机器人源码 编辑:程序博客网 时间:2024/05/02 02:26
:animated Selector
选择所有和选择器同时在运行的动画元素
:eq() Selector
选择匹配元素集合中索引为n的元素
译者注:匹配给定索引值的元素,索引值是从0开始的。
:even Selector
选择所有索引值为偶数的元素,同见odd.
译者注:选择匹配元素中索引值为偶数的元素,索引值是从0开始的。
:first Selector
选择第一个匹配的元素
:focus selector
选择正在被focused的元素
:gt() Selector
选择所有比给定索引值大的匹配元素
译者注:匹配所有大于给定索引值的元素,索引值是从0开始的。
:header Selector
选择所有的标题元素比如h1,h2,h3等等
:last Selector
选择最后一次匹配的元素
:lt() Selector
选择所有比给定索引值小的所有匹配的元素
:not() Selector
选择所有和给定选择器不匹配的元素
:odd Selector
选择所有索引值为奇数的元素,同见even
<script> $("#run").click(function(){//改变所有正在运行动画的div元素的颜色 $("div:animated").toggleClass("colored"); }); function animateIt() { $("#mover").slideToggle("slow", animateIt); } animateIt();</script>
<script>$("td:eq(2)").css("color", "red");//查找第三个td</script>
<script>$("tr:even").css("background-color", "#bbbbff");//查找index是偶数的table行,匹配第一,第三行等等(索引是0,2,4等)</script>
<script>$("tr:first").css("font-style", "italic");//查找第一行</script>
<script>$( "#content" ).delegate( "*", "focus blur", function( event ) {//添加class到所有focus的元素上 var elem = $( this ); setTimeout(function() { elem.toggleClass( "focused", elem.is( ":focus" ) ); }, 0);});</script>
<script>$("td:gt(4)").css("text-decoration", "line-through");//查找TD#5(元素的text值)或更高,记住:索引从0开始</script>
<script>$(":header").css({ background:'#CCC', color:'blue' });//给页面上的所有标题元素添加背景和文本颜色</script>
<script>$("tr:last").css({backgroundColor: 'yellow', fontWeight: 'bolder'});//查找最后一个table行</script>
<script>$("td:lt(4)").css("color", "red");//查找比索引值4小的所有TD元素</script>
<script> $("input:not(:checked) + span").css("background-color", "yellow"); $("input").attr("disabled", "disabled");//查找所有未被checked的元素,并给下一个同级span元素添加highlights。注意,当点击checkboxes的时候不会有所改变,因为没有单击事件被关联</script>
<script>$("tr:odd").css("background-color", "#bbbbff");//查找索引为奇数的table行,匹配第二,第四等等行(索引是1,3,5等等)</script>
- jQuery基本过滤选择器
- jquery基本过滤选择器
- jQuery基本过滤选择器
- JQuery 基本过滤选择器
- jQuery基本过滤选择器
- jQuery基本过滤选择器
- jquery基本过滤选择器
- jQuery-基本过滤选择器
- jQuery过滤选择器-基本过滤选择器
- Jquery过滤选择器之基本过滤选择器
- 使用jQuery基本过滤选择器
- jQuery 的基本过滤选择器
- 使用Jquery基本过滤选择器
- jQuery的基本过滤选择器
- jQuery选择器 过滤选择器(一.基本过滤选择器)
- Jquery(五)过滤选择器之基本过滤
- jquery选择器之基本过滤选择器
- jQuery选择器——基本过滤选择器
- easybsd 安装 win7 64bit 和ubuntu12.04 amd 64 bit 双系统
- 华为报告称2013年大数据将引发IT系统大变革
- CLASSPATH详解
- 理解 Thread.Sleep 函数
- Lowest Common Ancestor(Python版)
- jQuery基本过滤选择器
- 玩vim第一篇之backspace为啥无效
- PHP CURL使用CURLOPT_COOKIEJAR没有保存文件的解决办法
- jQuery内容过滤选择器
- LeetCode Best Time to Buy and Sell Stock
- TMX Tilemaps & Box2D Fixtures
- Yii框架登录验证和全局访问用户ID
- jQuery属性选择器
- 从csdn学到的c的基础之外的知识