Jquery Effect Use detailed

Source: Internet
Author: User

. Hide ()

Hides a matching element.

. Hide ()

This method does not accept any parameters.

. Hide ([Duration][,complete])
Duration

A string or number determines how long the animation will run.
Complete

The function that executes when the animation finishes executing.
. Hide ([Duration][,easing][,complete])
Duration

A string or number determines how long the animation will run.
Easing

A string that indicates which easing function to use for the transition.
Complete

The function to execute when the animation is complete.
Usage:

$ (' button '). Click (function () {$ (' P '). Hide (2000)}); $ ("div"). Click (function () {$ (this). Hide (2000,function () {$ (this). Remove ()})})

. Show ()

Displays the matching elements.

. Show ()

This method does not accept any parameters.
. Show ([Duration][,complete])
Duration

A string or number determines how long the animation will run.
Complete

The function that executes when the animation finishes executing.
. Show ([Duration][,easing][,complete])
Duration

A string or number determines how long the animation will run.
Easing

A string that indicates which easing function to use for the transition.
Complete

The function to execute when the animation is complete.

Usage:

$ ("button"). Click (function () {$ ("P"). Show ("slow");    });    $ ("div"). First (). Show ("Fast", function Shownext () {$ (this). Next ("Div"). Show ("Fast", shownext); });

. Toggle ()

Shows or hides the matching elements.

. Toggle ()

This method does not accept any parameters.
. Toggle ([Duration][,complete])
Duration

A string or number determines how long the animation will run.
Complete

The function that executes when the animation finishes executing.
. Toggle ([Duration][,easing][,complete])
Duration

A string or number determines how long the animation will run.
Easing

A string that indicates which easing function to use for the transition.
Complete

The function to execute when the animation is complete.

Usage:

$ ("button"). Click (function () {$ ("P"). Toggle ();    });    $ ("button"). Click (function () {$ ("P"). Toggle ("slow"); });

. Animate ()

Performs a custom animation based on a set of CSS properties.

. Animate (Properties[,duration][,easing][,complete])
Properties

A CSS property and value object that the animation will move according to this set of objects.
Duration (default: 400)

A string or number determines how long the animation will run.
Easing (default swing)

A string that indicates which easing function is used excessively.
Complete

The function that executes when the animation finishes executing.
. Animate (Properties,options)
Properties

A CSS property and value object that the animation will move according to this set of objects.
Options

A set of values that contain animation options.

Usage:

$ ("#go"). Click (function () {$ ("#block"). Animate ({width: "70%", opacity:0.4, MarginLeft: "0.6in"    , FontSize: "3em", BorderWidth: "10px"}, 1500);    });    $ ("#right"). Click (function () {$ (". Block"). Animate ({"Left": "+=50px"}, "slow"); });

Apply animations to all paragraphs so that their left property becomes 50, the transparency becomes 1 (that is, opaque, visible), and 500 milliseconds.

$ ("P"). Animate ({left:50, opacity:1}, 500);

. Delay ()

Set a delay to defer execution of subsequent entries in the queue.

. Delay (Duration[,queuename])
Duration

An integer that indicates the number of milliseconds to use to set the time for the next queue to defer execution.
QueueName

A string that is the name of the queue.

Effect:

We can set a delay of 800 milliseconds between <div id= "foo" > 's. slideup () and. FadeIn () Animations:

$ (' #foo '). Slideup. Delay (+). FadeIn (400);

Hide and show two Div. Where the green div is displayed, there is a delay of 800 milliseconds.

$ ("button"). Click (function () {$ ("Div.first"). Slideup (+). FadeIn (400);  $ ("Div.second"). Slideup. FadeIn (400); });

. Stop ()

Stops the animation that matches the element that is currently running.

. Stop ([clearqueue][,jumptoend])
Clearqueue

A Boolean value that indicates whether to suppress the animation to the queue, false by default;
Jumptoend

A Boolean value that indicates whether the current animation is completed immediately. Default false;
. Stop ([queue] [, Clearqueue] [, Jumptoend])
Queue

Stops the name of the animation queue.
Clearqueue

A Boolean value that indicates whether to suppress the animation in the queue. False by default.
Jumptoend

A Boolean value that indicates whether the current animation is completed immediately. False by default.

Usage:

$ ("#stop"). Click (function () {$ (". Block"). Stop (); }); Stop the animation as soon as you click on the operation.

. FadeIn ()

Displays the matching elements in a fade-in fashion.

. FadeIn ([Duration][,complete])
Duration (default: 400)

A string or number determines how long the animation will run.

Complete

The function to execute when the animation is complete.
. FadeIn (Options)

A set of values that contain animation options.
. FadeIn ([Duration][,easing][,complete])
Duration (default: 400)

A string or number determines how long the animation will run.

Easing (default: Swing)

A string that indicates which easing function to use for the transition

Complete

The function to execute when the animation is complete.

Usage:

$ (". Btn2"). Click (function () {$ ("P"). FadeIn (); });

. FadeOut ()

Hides the matching elements in a fade-out manner.

. FadeOut ([Duration][,complete])
Duration (default: 400)

A string or number determines how long the animation will run.
Complete

The function to execute when the animation is complete.
. FadeOut (Options)

A set of values that contain animation options.
. FadeOut ([Duration][,easing][,complete])
Duration (default: 400)

A string or number determines how long the animation will run.
Easing (default: Swing)

A string that indicates which easing function to use for the transition
Complete

The function to execute when the animation is complete.

Usage:

$ (". Btn2"). Click (function () {$ ("P"). FadeOut (); });

. FadeTo ()

Adjusts the transparency of the matching element.

. FadeTo (Duration,opacity[,complete])
Duration

A string or number determines how long the animation will run.
Opacity

Numbers between 0 and 1 indicate the opacity of the target element
Complete

The function to execute when the animation is complete.
. FadeTo (Duration,opacity[,easing][,complete])
Duration

A string or number determines how long the animation will run.
Opacity

Numbers between 0 and 1 indicate the opacity of the target element
Easing

A string that indicates which easing function to use for the transition

Complete

The function to execute when the animation is complete.

Usage:

$ (' input '). Click (function () {$ (' #div1 '). FadeTo ("Slow", 0.2,function () {$ (' #div1 '). CSS ("display", "none          "); })      })

. Fadetoggle ()

Show or hide them by matching the opacity animations of the elements.

. Fadetoggle ([Duration][,easing][,complete])
Duration (default: 400)

A string or number determines how long the animation will run.
Easing (default: Swing)

A string that indicates which easing function to use for the transition
Complete

The function to execute when the animation is complete.
. Fadetoggle (Opacity)
Opacity

A set of values that contain animation options.

Usage:

$ ("Input"). Click (function () {$ (' #div1 '). Fadetoggle (2000)})

. Slidedown ()

Displays a matching element with a sliding animation.

. Slidedown ([Duration][,complete])
Duration

A string or number determines how long the animation will run.
Complete

The function to execute when the animation is complete.
. Slidedown (Opacity)
Opacity

A set of values that contain animation options.
. Slidedown ([Duration][,easing][,complete])
Duration

A string or number determines how long the animation will run.

Easing

A string that indicates which easing function is used excessively.

Complete

The function to execute when the animation is complete.

Usage:

$ ("Input"). Click (function () {$ (' #div1 '). Slidedown (2000)})

. Slideup ()

Hides a matching element with a sliding animation.

. Slideup ([Duration][,complete])
Duration

A string or number determines how long the animation will run.
Complete

The function to execute when the animation is complete.
. Slideup (Opacity)

Opacity

A set of values that contain animation options.
. Slideup ([Duration][,easing][,complete])
Duration

A string or number determines how long the animation will run.

Easing

A string that indicates which easing function is used excessively.

Complete

The function to execute when the animation is complete.

Usage:

$ ("Input"). Click (function () {$ (' #div1 '). Slideup (2000)})

. Slidetoggle ()

Shows or hides a matching element with a sliding animation.

. Slidetoggle ([Duration][,complete])
Duration

A string or number determines how long the animation will run.
Complete

The function to execute when the animation is complete.
. Slidetoggle (Opacity)
Opacity

A set of values that contain animation options.
. Slidetoggle ([Duration][,easing][,complete])
Duration

A string or number determines how long the animation will run.

Easing

A string that indicates which easing function is used excessively.

Complete

The function to execute when the animation is complete.

Effect:

$ ("Input"). Click (function () {$ (' #div1 '). Slidetoggle (2000)})

Jquery Effect Use detailed

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.