Rexdf

The devil is in the Details.

JQuery中$(#id)找不到,JQuery(#id)可以

| Comments

jQuery(function(){ jQuery(“.articlepost”).hover( function(){jQuery(this).addClass(“shaddow”);}, function(){jQuery(this).removeClass(“shaddow”); }); });

其它类库也用$(““)这样的格式,和jquery有冲突了。 jQuery()这种写法就是避免和其它类库同时使用时在用$这个东西的冲突的.代码可以这样改。 jQuery(function($){ $(“.articlepost”).hover( function(){$(this).addClass(“shaddow”);}, function(){$(this).removeClass(“shaddow”); }); });

Comments

http://qczx.us: 我主要用YUI,不过JQuery也是很不错的框架,收藏了。平民时尚,感谢分享。

Comments