Use. hide () for jQuery results ()
Hide matched elements.
. 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 is executed when the animation is executed.
. Hide ([duration] [, easing] [, complete])
Duration
A string or number determines how long the animation will run.
Easing
A string that indicates the easing function used in the transition.
Complete
The function that is executed when the animation is completed.
Usage:
$ ('Button '). click (function (){
$ ('P'). hide (2000)
});
$ ("P"). click (function (){
$ (This). hide (2000, function (){
$ (This). remove ()
})
})
. Show ()
Displays 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 is executed when the animation is executed.
. Show ([duration] [, easing] [, complete])
Duration
A string or number determines how long the animation will run.
Easing
A string that indicates the easing function used in the transition.
Complete
The function that is executed when the animation is completed.
Usage:
$ ("Button"). click (function (){
$ ("P"). show ("slow ");
});
$ ("P"). first (). show ("fast", function showNext (){
$ (This). next ("p"). show ("fast", showNext );
});
. Toggle ()
Show or hide matched 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 is executed when the animation is executed.
. Toggle ([duration] [, easing] [, complete])
Duration
A string or number determines how long the animation will run.
Easing
A string that indicates the easing function used in the transition.
Complete
The function that is executed when the animation is completed.
Usage:
$ ("Button"). click (function (){
$ ("P"). toggle ();
});
$ ("Button"). click (function (){
$ ("P"). toggle ("slow ");
});
. Animate ()
Execute a Custom Animation Based on a set of CSS attributes.
. Animate (PRoperties [, duration] [, easing] [, complete])
Properties
An object with css attributes and values. The animation moves based on this set of objects.
Duration (400 by default)
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 is executed when the animation is executed.
. Animate (properties, options)
Properties
An object with CSS attributes and values. The animation moves based on 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 an animation to all paragraphs so that the left attribute is changed to 50, and the transparency is changed to 1 (that is, opacity, visible), in 500 milliseconds.
$ ("P"). animate ({
Left: 50, opacity: 1
},500 );
. Delay ()
Set a delay to delay subsequent items in the execution queue.
. Delay (duration [, queueName])
Duration
An integer that indicates the number of milliseconds. It is used to set the delay time of the next queue.
QueueName
A string used as the queue name.
Effect:
We can
Set a latency of 800 milliseconds between. slideUp () and. fadeIn () animations:
$ ('# Foo'). slideUp (300). delay (800). fadeIn (400 );
Hide and then show two p. The green p has a latency of 800 milliseconds before it is displayed.
$ ("Button"). click (function (){
$ ("P. first"). slideUp (300). delay (800). fadeIn (400 );
$ ("P. second"). slideUp (300). fadeIn (400 );
});
. Stop ()
Stop the animation that matches the element that is currently running.
. Stop ([clearQueue] [, jumpToEnd])
ClearQueue
A boolean value indicating whether to cancel queue animation. The default value is false;
JumpToEnd
A boolean value indicates whether the current animation is completed immediately. The default value is false;
. Stop ([queue] [, clearQueue] [, jumpToEnd])
Queue
The name of the Stop animation queue.
ClearQueue
A boolean value indicating whether to cancel an animation in line. The default value is false.
JumpToEnd
A boolean value indicates whether the current animation is completed immediately. The default value is false.
Usage:
$ ("# Stop"). click (function (){
$ (". Block"). stop ();
}); // Immediately stop the animation when you click this operation.
. FadeIn ()
The matching elements are displayed in a fade-in mode.
. FadeIn ([duration] [, complete])
Duration (400 by default)
A string or number determines how long the animation will run.
Complete
The function that is executed when the animation is completed.
. FadeIn (options)
A set of values that contain animation options.
. FadeIn ([duration] [, easing] [, complete])
Duration (400 by default)
A string or number determines how long the animation will run.
Easing (default: swing)
A string that indicates the easing function used in the transition.
Complete
The function that is executed when the animation is completed.
Usage:
$ (". Btn2"). click (function (){
$ ("P"). fadeIn ();
});
. FadeOut ()
Hide matching elements by fading out.
. FadeOut ([duration] [, complete])
Duration (400 by default)
A string or number determines how long the animation will run.
Complete
The function that is executed when the animation is completed.
. FadeOut (options)
A set of values that contain animation options.
. FadeOut ([duration] [, easing] [, complete])
Duration (400 by default)
A string or number determines how long the animation will run.
Easing (default: swing)
A string that indicates the easing function used in the transition.
Complete
The function that is executed when the animation is completed.
Usage:
$ (". Btn2"). click (function (){
$ ("P"). fadeOut ();
});
. FadeTo ()
Adjust the transparency of matching elements.
. FadeTo (duration, opacity [, complete])
Duration
A string or number determines how long the animation will run.
Opacity
The number between 0 and 1 indicates the opacity of the target element.
Complete
The function that is executed when the animation is completed.
. FadeTo (duration, opacity [, easing] [, complete])
Duration
A string or number determines how long the animation will run.
Opacity
The number between 0 and 1 indicates the opacity of the target element.
Easing
A string that indicates the easing function used in the transition.
Complete
The function that is executed when the animation is completed.
Usage:
$ ('Input'). click (function (){
$ ('# P1'). fadeTo ("slow", 0.2, function (){
Certificate ('{p1'}.css ("display", "none ");
})
})
. FadeToggle ()
Show or hide an element by matching its opacity animation.
. FadeToggle ([duration] [, easing] [, complete])
Duration (400 by default)
A string or number determines how long the animation will run.
Easing (default: swing)
A string that indicates the easing function used in the transition.
Complete
The function that is executed when the animation is completed.
. FadeToggle (opacity)
Opacity
A set of values that contain animation options.
Usage:
$ ("Input"). click (function (){
$ ('# P1'). fadeToggle (2000)
})
. SlideDown ()
Use a slide animation to display a matching element.
. SlideDown ([duration] [, complete])
Duration
A string or number determines how long the animation will run.
Complete
The function that is executed when the animation is completed.
. 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 that is executed when the animation is completed.
Usage:
$ ("Input"). click (function (){
$ ('# P1'). slideDown (2000)
})
. SlideUp ()
Hide 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 that is executed when the animation is completed.
. 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 that is executed when the animation is completed.
Usage:
$ ("Input"). click (function (){
$ ('# P1'). slideUp (2000)
})
. SlideToggle ()
Use a slide animation to show or hide a matching element.
. SlideToggle ([duration] [, complete])
Duration
A string or number determines how long the animation will run.
Complete
The function that is executed when the animation is completed.
. 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 that is executed when the animation is completed.
Effect:
$ ("Input"). click (function (){
$ ('# P1'). slideToggle (2000)
})
The above is the content used for jQuery effect. For more related articles, please follow the PHP Chinese Network (www.php1.cn )!