Home > Web Front-end > JS Tutorial > Share a JQuery learning example

Share a JQuery learning example

零下一度
Release: 2017-06-26 11:24:49
Original
1186 people have browsed it

The difference between the window.onload() method in JS and $(document).read(function( ){ }) in Jquery:

  1. 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;

  2. $(document).read(function( ){ }) can be abbreviated as $(function( ) { }) ;

  3. $(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:

  1. show() / hide ()

  2. fadeIn() / fadeOut()

  3. 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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template