Jquery_day2
Event binding
-
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
- $ () Obj.parent (); Get parent node object tag
- $ () Obj.parents (); Gets the label of an object at all levels ancestor nodes
- Get ancestor node containing the specified label object selected; $ () obj.parents (selector)
- $ () Obj.children (); Gets label object all child nodes
- $ () Obj.children (selector); obtaining object of child nodes containing the specified tag selector
- $ () Obj.next (); tag objects acquired next sibling node is equivalent to the js nextSibing ()
- $ () Obj.prev () Gets the label of an object on a sibling
Animation related methods
- $ (Selector) the .Show (parameters); ms fade-in effect from the top left corner of the browser, fade time parameter
- $ (Selector) .fadeIn (parameter) parameter Fade fade time in milliseconds
- $ (Selector) .slideDown (parameters); Parameter slides downward sliding time in milliseconds
- $ (Selector) .hide (parameter); from the top left corner of the browser parameters fade time in milliseconds
- $ (Selector) .fadeOut (parameters); fade time in milliseconds parameters
- $ (Selector .slideUp (); swipe up time in milliseconds parameters
Plug
- 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
- 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
- Id selector selector
- Create a $ ( "dynamic text label stitching") label object
- empty empty internal elements
- remove without also removing themselves together
- Cardiff label .append (sub) add
- prop ( "attribute name", "property value")
- obj.val () input tag to retrieve and modify the value attribute
- parent () to get the parent label object
- Programmatic event binding $ () obj.click (function () {function after the trigger event listener function})
- After loading the page run: $ ({page content execution after loading} function ())