Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

jQuery UI API – .effect()

jQuery UI API - .effect()

Category

Effects | Effects Core | Methods

Usage

**Description:** Apply an animated effect to an element.

Returns:jQuery

.effect( effect [, options ] [, duration ] [, complete ] )

Parameters Type Description Default value
effect String A string indicating whicheffect。
options Object The specific settings for the effect and easing。
duration Number or String A string or a number specifying how long the animation will run. 400
complete Function() function to call once the animation is complete.

.effect( options )

Parameters Type Description
options Object all animation settings. The only required property is effect.
  • effect
    Type: String
    Description: A string indicating whicheffect。
  • easing(default:"swing")
    Type: String
    Description: a string indicating the easing function in Vue 3.
  • duration(default:400)
    Type: Number or String
    Description: a string or a number specifying how long the animation will run.
  • complete
    Type: Function()
    Description: the function to call once the animation is complete.
  • queue(default:true)
    Type: Boolean or String
    Description: a boolean indicating whether to place the animation in the effects queue. If false, the animation starts immediately.As of jQuery 1.7,the queue option also accepts a string, in which case the animation is added to the queue represented by that string.
  • |

    .effect() method applies a named animation to an element effect . Many effects also support show or hide modes, which can be achieved via the .show()、.hide() and .toggle() methods.

    Example

    Apply the Bounce Effect to a div.

    
    
    
    
    
    
    
    
      
    
      .effect() 演示
    
      
    
      
    
      
    
      
    
    
    
    
    
     
    
    

    点击任意地方应用特效。