While looking at the book "Sharp jquery", at the end of the book summed up some of jquery's usage skills, it feels very practical, the first collection of the later use, you can learn to see.
One, resources ( first and second editions can be found in W3cfuns resources )
"Sharp jquery": http://pan.baidu.com/share/link?shareid=1725756399&uk=4245516461 (PDF)
http://www.readfar.com/books/5520ce503063e1f304000696(ebup)
Source:http://pan.baidu.com/share/link?shareid=104027&uk=2030367496
Two, the code
1. Disable the page's right-click menu
$ (document). Ready (function () { $ (document). Bind ("ContextMenu", function (e) { return false; }); });
2. Determine browser type
$ (document). Ready (function () { ///Firefox 2 and above if ($.browser.mozilla && $.browser.version >= " 1.8 ") { //do something } //Safari if ($.browser.safari) { //do something } //Chrome if ($.browser.chrome) { //do something } //Opera if ($.browser.opera) { //Do Something } //IE6 and below if ($.browser.msie && $.browser.version <= 6) { alert ("IE6" )} //Anything above IE6 if ($.browser.msie && $.browser.version > 6) { alert ("IE6 Above")} });
3, input box text input and lose focus
<input type= "text" class= "Text1"/><script>$ (document). Ready (function () { $ ("Input.text1"). Val (" Enter your search text here. "); Textfill ($ (' input.text1 ')); }); function Textfill (input) {//input focus text function var originalvalue = Input.val (); Input.focus (function () { if ($.trim (Input.val ()) = = OriginalValue) {input.val (')} }). Blur (function () { if ($.trim (Input.val ()) = = ") {input.val (originalvalue);} }); } </script>
4. Return to head slide animation
<! doctype>
5, get mouse position
<! doctype>
6, determine if the element exists
<! doctype>
7, click div to jump
<! doctype>
8, set Div in the center of the screen
<! doctype>
9, turn off and turn on animation effects
<! doctype>
10. Detect the right and left mouse buttons
<! doctype>
11, enter submit form
<! doctype>
12, set the global AJAX parameters
<! DOCTYPE >
"Sharp jquery" source Finishing--jquery Tips