摘要: 1.eq(index)2.filter(expr)3.filter(function)4.hasClass(class)5.is(expr)6.has(expr)7.map(callback)8.not(expr)9.slice(start [,end]) 不包括end实例和效果如下: 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2 <html> 3 <head> 4 <meta http-equiv="Content-Type&quo 阅读全文
posted @ 2012-07-09 16:58 lihui_yy 阅读(1742) 评论(0) 推荐(0) 编辑
摘要: 1.andSelf() 新增自身对象到当前的jQuery对象里,通常用法:$('li.third-item').nextAll().andSelf() .css('background-color', 'red'); 2.end() 返回到上一次jQuery对象, 通常用于链式操作里:$('ul.first').find('.foo').css('background-color', 'red').end().find('.bar').css('backgro 阅读全文
posted @ 2012-07-09 15:30 lihui_yy 阅读(1030) 评论(0) 推荐(0) 编辑
摘要: jQuery 对页面元素的搜索包括 父元素、同辈元素、子元素 的搜索。1.父元素搜索(1)parents([selector]) 方法$("p").parents().css("border","1px solid #999"); //给p元素的父元素添加边框样式$("p").parents("div").css(...); //给p元素的父元素中的div元素添加样式(2)closest(selector[,context]) 方法$("p").closest("d 阅读全文
posted @ 2012-07-09 13:26 lihui_yy 阅读(10589) 评论(0) 推荐(0) 编辑