2012年6月26日
摘要: hasClass(className):判断匹配的元素是否含某个类 @param (string) className; @return (boolean) 1 var className = " " + selector + " ", 2 i = 0, 3 l = this.length; 4 for ( ; i < l; i++ ) { 5 /* 6 1.最关键是使用到indexOf 7 */ 8 ... 阅读全文
posted @ 2012-06-26 14:55 musickog 阅读(157) 评论(0) 推荐(0) 编辑
摘要: addClass(className):为匹配的元素添加类名 @param (string) className @return (jQuery) 1 /* 2 1.对传进的参数value进行检测 3 */ 4 if ( value && typeof value === "string" ) { 5 /* 6 2.将参数value分割为数组classNames 7 */ 8 classN... 阅读全文
posted @ 2012-06-26 14:27 musickog 阅读(154) 评论(0) 推荐(0) 编辑
摘要: removeClass(className):从匹配的元素中删除类 @param (string) className @return (jQuery) 1 /* 2 1.对传进的参数value进行检测 3 */ 4 if ( value && typeof value === "string" ) { 5 /* 6 2.将参数value分割为数组classNames 7 */ 8 cla... 阅读全文
posted @ 2012-06-26 11:53 musickog 阅读(159) 评论(0) 推荐(0) 编辑