¡¡¡¡21. д×Ô¼ºµÄÑ¡ÔñÆ÷
1. $(document).ready(function() { 2. $.extend($.expr[':'], { 3. moreThen1000px: function(a) { 4. return $(a).width() > 1000; 5. } 6. }); 7. $('.box:moreThen1000px').click(function() { 8. // creating a simple js alert box 9. alert('The element that you have clicked is over 1000 pixels wide'); 10. }); 11. }); |
¡¡¡¡22. ͳ¼ÆÔªËظöÊý
1. $(document).ready(function() { 2. $("p").size(); 3. }); |
¡¡¡¡23. ʹÓÃ×Ô¼ºµÄ Bullets
1. $(document).ready(function() { 2. $("ul").addClass("Replaced"); 3. $("ul > li").prepend("? "); 4. // how to use 5. ul.Replaced { list-style : none; } 6. }); |
¡¡¡¡24. ÒýÓÃGoogleÖ÷»úÉϵÄJqueryÀà¿âLet Google host the jQuery script for you. This can be done in 2 ways.
1. //Example 1 2. <SCRIPT src="http://www.google.com/jsapi"></SCRIPT> 3. <SCRIPT type=text/javascript> 4. google.load("jquery", "1.2.6"); 5. google.setOnLoadCallback(function() { 6. // do something 7. }); 8. </SCRIPT><SCRIPT src=http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js type=text/javascript></SCRIPT> 9. 10. // Example 2:(the best and fastest way) 11. <SCRIPT src=http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js type=text/javascript></SCRIPT> |
¡¡¡¡25. ½ûÓÃJquery£¨¶¯»£©Ð§¹û
1. $(document).ready(function() { 2. jQuery.fx.off = true; 3. }); |
¡¡¡¡26. ÓëÆäËûJavascriptÀà¿â³åÍ»½â¾ö·½°¸
1. $(document).ready(function() { |
Ïà¹ØÔĶÁ£º