201704项目日志_学习了几个jQuery函数

本文介绍了jQuery中常用的DOM操作方法,包括获取元素、增加类、移除类等,并详细解释了bind与click方法的区别及bind方法的多种用法。

siblings(); 兄弟姐妹元素选择处理
slidetoggle();展开折叠
toggleClass();设置移除元素切换
parent();获取父元素
children(); 获取子元素
addClass(); 增加class
removeClass();移除class
hasClass();判断是否有这个class
slideDown(); slideUp();滑动方式显示隐藏元素

window.location.href =    

============================================

bind("click",function(){})和 click(function(){})的区别

bind支持同时多个事件
比如
bind( { "click" : function(){}, "mouseover": fucntion(){} } )

通过bind绑定的事件,可以使用unbind来为这个元素解除绑定。

bind 可以同时绑定多个事件:

1

2

3

$('#foo').bind('mouseenter mouseleave'function() {

    $(this).toggleClass('entered');

});

 


 

转载于:https://my.oschina.net/chendongj/blog/884582

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值