29. ʹԪËؾÓÆÁÄ»ÖмäλÖÃ
$(document).ready(function(){ jQuery.fn.center=function(){ this.css("position","absolute"); this.css("top",($(window).height()-this.height())/2+$(window).scrollTop()+"px"); this.css("left",($(window).width()-this.width())/2+$(window).scrollLeft()+"px"); returnthis; } $("#id").center(); });30. д×Ô¼ºµÄÑ¡ÔñÆ÷
$(document).ready(function(){ $.extend($.expr[':'],{ moreThen1000px:function(a){ return$(a).width()>1000; } }); $('.box:moreThen1000px').click(function(){ //creatingasimplejsalertbox alert('Theelementthatyouhaveclickedisover1000pixelswide'); }); });31. ͳ¼ÆÔªËظöÊý
$(document).ready(function(){ $("p").size(); });32. ʹÓÃ×Ô¼ºµÄ Bullets
$(document).ready(function(){ $("ul").addClass("Replaced"); $("ul>li").prepend("?"); //howtouse ul.Replaced{list-style:none;} });33. ÒýÓÃGoogleÖ÷»úÉϵÄJqueryÀà¿â
//Example1 <SCRIPTsrc="http://www.google.com/jsapi"></SCRIPT> <SCRIPTtype=text/javascript> google.load("jquery","1.2.6"); google.setOnLoadCallback(function(){ //dosomething }); </SCRIPT><SCRIPTtype=text/javascriptsrc="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></SCRIPT> //Example2:(thebestandfastestway) <SCRIPTtype=text/javascriptsrc="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></SCRIPT>34. ½ûÓÃJquery£¨¶¯»£©Ð§¹û
$(document).ready(function(){ jQuery.fx.off=true; });35. ÓëÆäËûJavascriptÀà¿â³åÍ»½â¾ö·½°¸
$(document).ready(function(){ var$jq=jQuery.noConflict(); $jq('#id').show(); });
¡¡