The difference between the window.onload() method in JS and $(document).read(function( ){ }) in Jquery:
The loading timing is different Similarly, window.onload() needs to wait until all files are loaded (js, css files, and image resources), while the Jquery method only needs to wait for the DOM tree to be formed;
$(document).read(function( ){ }) can be abbreviated as $(function( ) { }) ;
$(document).read(function( ){ }) Multiple functions can be bound, but window.onload() only has this one event.
Two synthetic events in Jquery: hover And the toggle event, the toggle event can place any number of functions, and call the function through the click loop. When toggle is called as a function, it means the display and hiding of the element node.
There is also a slideToggle (), which integrates slideUp() and solidDown(),
Three animations in Jquery:
show() / hide ()
fadeIn() / fadeOut()
slideUP() / slideDown()
Animation packaging method: animate() ,
The above is the detailed content of Share a JQuery learning example. For more information, please follow other related articles on the PHP Chinese website!