使用jQuery基本过滤选择器
<script type="text/javascript">
$(function(){ //增加第一个元素的类别
$("li:first").addClass("GetFocus");
})
$(function(){ //增加最后一个元素的类别
$("li:last").addClass("GetFocus");
})
$(function(){ //增加去除所有与给定选择器匹配的元素类别
$("li:not(.NotClass)").addClass("GetFocus");
})
$(function(){ //增加所有索引值为偶数的元素类别,从0开始计数
$("li:even").addClass("GetFocus");
})
$(function(){ //增加所有索引值为奇数的元素类别,从0开始计数
$("li:odd").addClass("GetFocus");
})
$(function(){ //增加一个给定索引值的元素类别,从0开始计数
$("li:eq(1)").addClass("GetFocus");
})
$(function(){ //增加所有大于给定索引值的元素类别,从0开始计数
$("li:gt(1)").addClass("GetFocus");
})
$(function(){ //增加所有小于给定索引值的元素类别,从0开始计数
$("li:lt(4)").addClass("GetFocus");
})
$(function(){ //增加标题类元素类别
$("div h1").css("width","238");
$(":header").addClass("GetFocus");
})
$(function(){
animateIt(); //增加动画效果元素类别
$("#spnMove:animated").addClass("GetFocus");
})
function animateIt() { //动画效果
$("#spnMove").slideToggle("slow", animateIt);
}
</script>
使用jQuery基本过滤选择器的更多相关文章
- jQuery 简单过滤选择器
<!DOCTYPE HTML> <html> <head> <title> 使用jQuery基本过滤选择器 </title> <scr ...
- jQuery简单过滤选择器
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <!--jQuery选择器详解 根据所获 ...
- jQuery基本过滤选择器
jQuery基本过滤选择器: <h1>this is h1</h1> <div id="p1"> <h2>this is h2< ...
- Jquery的过滤选择器分为哪几种?
Jquery的过滤选择器分为哪几种? 转载▼ 标签: jquery 过滤选择器 分类 分类: JQuery 所有的过滤选择器分为哪几种: 一.基本过滤选择器(重点掌握下列八个) :first 选取第一 ...
- 第一百六十五节,jQuery,过滤选择器
jQuery,过滤选择器 学习要点: 1.基本过滤器 2.内容过滤器 3.可见性过滤器 4.子元素过滤器 5.其他方法 过滤选择器简称:过滤器.它其实也是一种选择器,而这种选择器类似与 CSS3 (h ...
- jquery :checked(过滤选择器) 和 空格:checked(后代选择器)
jquery 过滤选择器 和 后代选择器 <%@ page language="java" contentType="text/html; charset=UTF- ...
- JQuery 可见性过滤选择器
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <m ...
- JQuery 内容过滤选择器
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <m ...
- jQuery内容过滤选择器与子元素过滤选择器用法实例分析
jQuery选择器内容过滤 一.:contains(text) 选择器::contains(text)描述:匹配包含给定文本的元素返回值:元素集合 示例: ? 1 2 $("div.mini ...
- jquery :checked(过滤选择器) 和 空格:checked(后代选择器)【转】
jquery 过滤选择器 和 后代选择器 <%@ page language="java" contentType="text/html; charset=UTF- ...
随机推荐
- POJ 2891 Strange Way to Express Integers(中国剩余定理)
题目链接 虽然我不懂... #include <cstdio> #include <cstring> #include <map> #include <cma ...
- 如何获取checkboxlist的多个选中项
string[] array = dt.Rows[0]["s_type"].ToString().Split('|'); foreach (ListI ...
- List 中对象属性排序
有几个方法可以实现:让 Student 实现Comparable接口,或是实例化一 个比较器, 现在用 Comparator 比较器实例来做一个:ComparableTest.java import ...
- Asp反向代理程序,调用远程站点全站数据,一款脚本级反向代理程序.
前些天临时写的一脚本级反向代理程序,用法很简单,设置好目标站地址,然后放到你网站根目录:index.asp,再将404页面自定义为:index.asp,即可. 由于暂时没有 url 替换需要,所以没有 ...
- ElasticSearch实战-日志监控平台
1.概述 在项目业务倍增的情况下,查询效率受到影响,这里我们经过讨论,引进了分布式搜索套件——ElasticSearch,通过分布式搜索来解决当下业务上存在的问题.下面给大家列出今天分析的目录: El ...
- T-SQL DBMS
dbo 默认架构schema 从一个数据库操作另个数据库的表的时候,要select * from 数据库.dbo.biao 表名前面的dbo是一个默认架构schema,一个架构还有 ...
- 18. 求交错序列前N项和
求交错序列前N项和 #include <stdio.h> int main() { int numerator, denominator, flag, i, n; double item, ...
- SVN svnserve.conf: Option expected 的解决方法 以及 Authorization failed 的解决方法
① 在 CentOS 6.5 上安装配置了 SVN,在本地 Checkout 的时候报错: 显示:/www/svnroot/webfile/conf/svnserve.conf:12: Option ...
- Javascript 笔记与总结(1-5)闭包
[例1] <script> function t1(){ var age = 20; function t2(){ alert(age); } return t2; } var tmp = ...
- MyBatis传入参数为集合 list 数组 map写法
foreach的主要用在构建in条件中,它可以在SQL语句中进行迭代一个集合.foreach元素的属性主要有item,index,collection,open,separator,close.ite ...