使用Jquery基本过滤选择器

<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <meta name="Generator" content="EditPlus®">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
  <title>使用Jquery基本过滤选择器</title>
  <script src="jquery-1.8.0.js"></script>
 </head>
 <style type="text/css">
	body{
		font-size:12px;
		text-align:center;
	}
	div{
		width:241px;
		height:83px;
		border:solid 1px #f00;
	}
	h1{
		font-size:13px;
	}
	ul{
		list-style-type:none;
		padding:0px;
	}
	.DefClass,.NotClass{
		height:23px;
		width:60px;
		line-height:23px;
		float:left;
		border-top:solid 1px #000;
		border-bottom:solid 1px #000;
	}
	.GetFous{
		width:58px;
		border:solid 1px #666;
		background-color:#eee;
	}

	#spnMove{
		width:238px;
		height:23px;
		line-height:23px; 
	}
 </style>
 
 <script type="text/javascript">
 /*
	$(function(){
		$("li:first").addClass("GetFous");
	});
	$(function(){
		$("li:last").addClass("GetFous");
	});
	$(function(){
		$("li:not(.NotClass)").addClass("GetFous");
	});
	$(function(){
		$("li:even").addClass("GetFous");
	});
	$(function(){
		$("li:odd").addClass("GetFous");
	});
	$(function(){
		$("li:eq(2)").addClass("GetFous");
	});
	$(function(){
		$("li:gt(2)").addClass("GetFous");
	});
	$(function(){
		$("li:lt(4)").addClass("GetFous");
	});
	$(function(){
		$("div h1").css("width","238");
		$(":header").addClass("GetFous");
	});
	*/	
	$(function(){
		animateIt();
		$("#spnMove:animated").addClass("GetFous");
	});
	function animateIt(){	
		$("#spnMove").slideToggle("slow",animateIt);
	}
 </script>
 <body>
	<div>
		<h1>基本过程选择器</h1>
		<ul>
			<li class="DefClass">Item 0</li>
			<li class="DefClass">Item 1</li>
			<li class="NotClass">Item 2</li>
			<li class="DefClass">Item 3</li>
		</ul>
		<span id="spnMove">Span Move</span>
	</div>
 </body>
</html>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值