$(function() {
$(“ul”).addClass(“Replaced”);
$(“ul > li”).prepend(“ “);
// how to use
ul.Replaced { list-style : none; }
});
33. 引用Google主机上的Jquery类库(谷歌用不了,可以用百度CDN)
//Example 1
<script src=””></script><script>// <![CDATA[
google.load("jquery", "1.2.6"); google.setOnLoadCallback(function() { // do something });
// ]]></script><script src=””></script>// Example 2:(the best and fastest way)<script src=””></script>
34. 禁用Jquery(动画)效果
$(function() {
jQuery.fx.off = true;
});
35. 与其他Javascript类库冲突解决方案
$(function() {
var $jq = jQuery.noConflict();
$jq(‘#id’).show();
});
未经允许不得转载:wfuns » 常用的35个jQuery小技巧
分享到:()
上一篇Html属性disabled和readonly的区别?
相关推荐