"Sharp jquery" source Finishing--jquery Tips

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.