Events and animations in jquery
I. Events
Page load
$ (document). Ready (function () {xxxxx})
Shorthand
$ (function () {
Do something
})
Element Binding Event
Bind () on ()
Bing (event type, optional parameter: Additional data object for event object, binding handler function);
Hover () toggle ()//1.91 version post-removal workaround see my other Post
Custom events
Event bubbling
<script type="Text/javascript">$ (function () {//binding The Click event for a SPAN element$('span'). Bind ("Click", function () {varTXT = $ ('#msg'). HTML () +"<p> inner span element is clicked .<p/>"; $('#msg'). html (TXT); }); //binding The Click event for a DIV element$('#content'). Bind ("Click", function () {varTXT = $ ('#msg'). HTML () +"<p> outer div element is clicked .<p/>"; $('#msg'). html (TXT); }); //bind the Click event to the BODY element$("Body"). Bind ("Click", function () {varTXT = $ ('#msg'). HTML () +"<p>body element is clicked .<p/>"; $('#msg'). html (TXT); });})</script>"content">Outer DIV Element<span> Inner span elements </span>Outer DIV Element</div><div id="msg"></div>
Block Default Events
Event. Stoppropagation (); or Rturn false
<script type="Text/javascript"> $('#content'). Bind ("Click", Function (Event){ varTXT = $ ('#msg'). HTML () +"<p> outer div element is clicked .<p/>"; $('#msg'). html (TXT); Event. Stoppropagation (); });
removing events
Unbind
Simulation Events
Trigger () and one ()
Two. Animations
Skip Show Hide
Animate () method
"Sharp jquery" Reading notes four