使用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- ...
随机推荐
- Html A标签中 href 和 onclick 同时使用的问题 优先级别
我们在制作网页的时候用得最多的就是 A 标签 超连接 但有时候需要在 A 里同时用到 href 和 onclick属性 下面我们先来分析一下 ,在不同的浏览器下有不同的效果 1 顺序 ie 6 : h ...
- hdu-acm steps FatMouse's Speed
本想用暴力法先试试的,案例和自己找的数据都过掉了,但是始终wa,本来期待的是tle,结果始终wa.所以也就懒的管了,直接用dp来做了.主要是因为最近在刷暴力法和dp这两个专题,所以才想好好利用一下这道 ...
- 处理异常的 try,catch
try catch finally 1.将预见可能引发异常的代码包含在try语句块中. 2.如果发生了异常,则转入catch的执行.catch有几种写法: catch 这将捕获任何发生的异常. cat ...
- HTML5 挖宝
http://geek.csdn.net/news/detail/91536 http://mozilla.com.cn/thread-360325-1-1.html
- Linux /etc/passwd 和 /etc/group 文件格式
passwd: /etc/passwd 文件结构 2011-04-29 16:32:54| 分类: ubuntu技巧 | 标签:passwd linux ubuntu fadero centos./e ...
- 【液晶模块系列基础视频】4.2.X-GUI图形界面库-画矩形函数简介
[液晶模块系列基础视频]4.2.X-GUI图形界面库-画矩形函数简介 ============================== 技术论坛:http://www.eeschool.org 博客地址: ...
- centeros iptable模板文件
iptables规则是空的.而且他们的selinux是关闭了的,这等同于把系统裸奔(总比windows裸奔好). 使用方法: 1.用root用户登录后 vi /etc/sysconfig/ipta ...
- NBUT 1457 Sona(莫队算法+离散化)
[1457] Sona 时间限制: 5000 ms 内存限制: 65535 K 问题描述 Sona, Maven of the Strings. Of cause, she can play the ...
- NBOJv2 1050 Just Go(线段树/树状数组区间更新单点查询)
Problem 1050: Just Go Time Limits: 3000 MS Memory Limits: 65536 KB 64-bit interger IO format: % ...
- Nginx 笔记与总结(4)配置 server 访问日志
打开 nginx.conf: [root@localhost ~]# cd /usr/local/nginx/conf [root@localhost conf]# vim nginx.conf 在默 ...