[Jquery tutorial] jquery Effect

Source: Internet
Author: User
Jquery hide and display

Using the hide () and show () functions, jquery supports hiding and displaying HTML elements:

Instance

$ ("# Hide"). Click (function (){
$ ("P"). Hide ();
});
$ ("# Show"). Click (function (){
$ ("P"). Show ();
});

You can set two optional parameters for hide () and show (): Speed and callback.

Syntax:

$ (Selector). Hide (speed, callback)

$ (Selector). Show (speed, callback)

SpeedThe parameter specifies the display or hide speed. You can set these values: "slow", "fast", "normal", or millisecond.

CallbackThe parameter is the name of the function that is executed after the hide or show function is completed. You will learn more aboutCallbackParameter knowledge.

 

Jquery Switch

The jquery toggle () function uses the show () or hide () function to switch the visible state of HTML elements.

Hide the displayed elements.

Syntax:

$ (Selector). Toggle (speed, callback)

SpeedThe parameter can be set to "slow", "fast", "normal", or millisecond.

Instance

$ ("Button"). Click (function (){
$ ("P"). Toggle ();
});
CallbackThe parameter is the name of the function that is executed after the function is completed.

 

Jquery Effect

Method Description
Animate () Apply a "Custom" animation to the selected Element
Clearqueue () Remove all queued functions from selected elements (not running)
Delay () Set latency for all queuing functions (not running) of the selected Element
Dequeue () Run the next queuing function of the selected element.
Fadein () Fade in Selected elements to completely opaque
Fadeout () Fade out the selected element to completely opaque
Fadeto () Reduces the selected element to a given opacity.
Hide () Hide selected elements
Queue () Display the queuing function of the selected Element
Show () Show selected elements
Slidedown () Slide to display the selected element by adjusting the height
Slidetoggle () Switching between slide hiding and sliding display of Selected elements
Slideup () Slide to hide selected elements by adjusting the height
Stop () Stops running the animation on the selected element.
Toggle () Hide and display selected elements

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.