Jquery_day2

Jquery_day2

Event binding

  1. After loading the document execution

    Js

    • window.onload = function(){

      Content executed after the page loads

      }

    Jquery

    • $(document).ready(function(){

      Page loading content after the completion of the implementation of

      })

    • $(function(){

      Page loading content after the completion of the implementation of

      })

      Jquery events in property
    • click (), click

    • dblclick () Double-click on

    • mouseover () into mouse

    • mouseOut () Mouse out

    • blur () loses focus

    • focus () gets focus

    • submit () form submission

The method of operation of an object tag

  1. $ () Obj.parent (); Get parent node object tag
  2. $ () Obj.parents (); Gets the label of an object at all levels ancestor nodes
  3. Get ancestor node containing the specified label object selected; $ () obj.parents (selector)
  4. $ () Obj.children (); Gets label object all child nodes
  5. $ () Obj.children (selector); obtaining object of child nodes containing the specified tag selector
  6. $ () Obj.next (); tag objects acquired next sibling node is equivalent to the js nextSibing ()
  7. $ () Obj.prev () Gets the label of an object on a sibling

Animation related methods

  1. $ (Selector) the .Show (parameters); ms fade-in effect from the top left corner of the browser, fade time parameter
  2. $ (Selector) .fadeIn (parameter) parameter Fade fade time in milliseconds
  3. $ (Selector) .slideDown (parameters); Parameter slides downward sliding time in milliseconds
  4. $ (Selector) .hide (parameter); from the top left corner of the browser parameters fade time in milliseconds
  5. $ (Selector) .fadeOut (parameters); fade time in milliseconds parameters
  6. $ (Selector .slideUp (); swipe up time in milliseconds parameters

Plug

  1. Magnifier plug-in
    • The js files and css style file import plug-related projects
    • The corresponding js file and css styles to introduce the current page
  2. Form validation plugin
    • Related to the introduction of the js file and css style files
    • The document introduced the current file

The method often used summary

  1. Id selector selector
  2. Create a $ ( "dynamic text label stitching") label object
  3. empty empty internal elements
  4. remove without also removing themselves together
  5. Cardiff label .append (sub) add
  6. prop ( "attribute name", "property value")
  7. obj.val () input tag to retrieve and modify the value attribute
  8. parent () to get the parent label object
  9. Programmatic event binding $ () obj.click (function () {function after the trigger event listener function})
  10. After loading the page run: $ ({page content execution after loading} function ())

Guess you like

Origin blog.csdn.net/JiangLi_/article/details/90757971