摘要:
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 ... 阅读全文
摘要:
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... 阅读全文
摘要:
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... 阅读全文