return this.each(function ())

1 return this.each(function(){         
2     //代码        
3 });

this.each()执行完返回的是this,这时候再return this.each(),返回的依旧是this,而这个this上下文又是指代$(‘[title]‘),意味着你可以在colorTip()后继续加其他方法,比如:

1 $('[title]').colorTip({color:'yellow'}).size();

 

猜你喜欢

转载自www.cnblogs.com/oliwang/p/9189217.html
今日推荐