Jquery选择元素的方法
来源:互联网 发布:钟云龙徒弟知多少 编辑:程序博客网 时间:2024/04/28 08:01
.not() 从匹配元素集合中删除元素。
实例:lazyload延迟加载图片
jQuery(document).ready(function ($) {
$("img").not("#js-comment-box img,.bottom_bottom img").lazyload({
placeholder: "",
effect: showeffect,
threshold: 0,
failurelimit: 10
})
});
返回顶部
<div class="goTop"><a title="返回顶部" class="top" id="gotop_t" href="javascript:;"></a></div>
<script type="text/javascript">
$(document).ready(function () {
//当点击跳转链接后,回到页面顶部位置
$("#gotop_t").click(function () {
$('body,html').animate({ scrollTop: 0 }, 500);
return false;
});
})
</script>
选择(#sortlist)下的最后一个(div)下的第一个(div),添加名为(current)的类
<script>
$('#sortlist div:last-child').children("div:first-child").addClass('current')
</script>
移除(.banner)下(a)元素的(title)属性
<script>
$(".banner").children("a").removeAttr("title")
</script>
实例:lazyload延迟加载图片
jQuery(document).ready(function ($) {
$("img").not("#js-comment-box img,.bottom_bottom img").lazyload({
placeholder: "",
effect: showeffect,
threshold: 0,
failurelimit: 10
})
});
返回顶部
<div class="goTop"><a title="返回顶部" class="top" id="gotop_t" href="javascript:;"></a></div>
<script type="text/javascript">
$(document).ready(function () {
//当点击跳转链接后,回到页面顶部位置
$("#gotop_t").click(function () {
$('body,html').animate({ scrollTop: 0 }, 500);
return false;
});
})
</script>
选择(#sortlist)下的最后一个(div)下的第一个(div),添加名为(current)的类
<script>
$('#sortlist div:last-child').children("div:first-child").addClass('current')
</script>
移除(.banner)下(a)元素的(title)属性
<script>
$(".banner").children("a").removeAttr("title")
</script>
0 0
- Jquery选择元素的方法
- jQuery对选择元素的筛选方法集合
- jQuery选择id属性带有.点符号元素的方法
- jquery 选择带多个class的元素
- jQuery 选择具有特殊属性的元素
- jQuery,选择器,选择父页面的元素
- jQuery一行中元素的分类选择
- jquery框架获得常见的几个选择表单元素(select,radio,checkbox)值的方法:
- 总结一下jQuery操作元素节点的方法(创建、选择、插入节点)
- Jquery创建元素的方法
- jQuery 追加元素的方法
- 获取jquery元素的方法
- jQuery获取元素的方法
- jquery 添加元素的方法
- jquery追加元素的方法
- jQuery元素选择
- jquery 排除选择元素
- jquery选择元素....
- junit
- android实现通过浏览器点击链接打开apk
- 详解android系统的适配(px,density,dpi,分辨率)
- centos安装配置apache+php+mysql环境
- 将 cocos2dx 背景 设置 成 透明 的方法
- Jquery选择元素的方法
- 利用 jQuery UI 和 Ajax 创建可定制的 Web 界面(Portlet) (学习备份)
- quick3x_tiledMap瓦片地图
- c++实现数组的插入和删除
- MySQL常用DDL
- 自己动手编写一些简单的转场动画
- hadoop学习---2.cygwin及sshd安装配置
- Siebel计算列取余数问题
- 实时/历史数据库和关系型数据库的区别