//语法结构 stop([clearQueue][,gotoEnd]);
$("button:eq(1)").click(function(){
$("#panel").stop();//停止当前动画,继续下一个动画,继默认状态stop(false,false);
});
$("button:eq(2)").click(function(){
$("#panel").stop(true);//清除元素的所有动画
});
$("button:eq(3)").click(function(){
$("#panel").stop(false, true);//让当前动画直接到达末状态 ,继续下一个动画
});
$("button:eq(4)").click(function(){
$("#panel").stop(true, true);//清除元素的所有动画,让当前动画直接到达末状态
});
//filter:
$("li").filter(function(index){
return $('strong',this).length == 2;//搜索strong在this 中
}).css("backgroundColor","#f00")
/*<ul>
<li><strong>list</strong> item 1 - one strong tag</li>
<li><strong>list</strong> item <strong>2</strong>
- two <span>strong tags</span></li> //变为红色
<li>list item 3</li>
<li>list item 4</li>
</ul>*/
//filter:
1、选择器+遍历
$('div').each(function (i){
i就是索引值
this 表示获取遍历每一个dom对象
});
2、选择器+遍历
$('div').each(function (index,domEle){
index就是索引值
domEle 表示获取遍历每一个dom对象
});
3、更适用的遍历方法
1)先获取某个集合对象
2)遍历集合对象的每一个元素
var d=$("div");
$.each(d,function (index,domEle){
d是要遍历的集合
index就是索引值
domEle 表示获取遍历每一个dom对
});
})
4、end() 方法结束当前链条中的最近的筛选操作,并将匹配元素集还原为之前的状态。</span>