Home  >  Article  >  Web Front-end  >  Introduction to basic operations to achieve animation effects in jQuery_jquery

Introduction to basic operations to achieve animation effects in jQuery_jquery

WBOY
WBOYOriginal
2016-05-16 17:36:42916browse

Animation effect

show(): show

hide() hides

$().toggle(): Show and hide effect switching

You can pass in parameters, speed.

fadeOut(fade out)

fadeIn(fade in)

fadeToggle(); Fade in and out switching

fadeTo(2000,0.3) displays the image to a transparency of 30%

Sliding display

slideDown():

slideUp():

slideToggle():

You can pass in a speed parameter.

$(':animated'); Gets the element that is being animated.

Stop an animated element:

$(':animated').stop(): Stop the current animation.

stop(true) means to clear all animations in the queue, that is, the animation will stop immediately. If no parameters are passed, the current animation will be stopped immediately.

$(':animated').stop(false,true) The second parameter is true to stop the currently executing animation and set the element to the position where the current animation execution ends.

Statement:
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