Skip to main content
Version: Next

Animation

Methods

export

Exports the animation queue. The "export" method clears the previous animation operations each time it is called.

Reference

() => Record<string, any>[]

API Support

APIWeChat Mini-ProgramH5React Native
Animation.export✔️

backgroundColor

Sets the background color.

Reference

(value: string) => Animation
PropertyTypeDescription
valuestringColor value

API Support

APIWeChat Mini-ProgramH5React Native
Animation.backgroundColor✔️

bottom

Sets the bottom value.

Reference

(value: string | number) => Animation
PropertyTypeDescription
valuestring | numberLength value. If number is input, px is used by default. Other length values in custom units can be passed.

API Support

APIWeChat Mini-ProgramH5React Native
Animation.bottom✔️

height

Sets the height.

Reference

(value: string | number) => Animation
PropertyTypeDescription
valuestring | numberLength value. If number is input, px is used by default. Other length values in custom units can be passed.

API Support

APIWeChat Mini-ProgramH5React Native
Animation.height✔️

left

Set the left value

Reference

(value: string | number) => Animation
PropertyTypeDescription
valuestring | numberLength value. If number is input, px is used by default. Other length values in custom units can be passed.

API Support

APIWeChat Mini-ProgramH5React Native
Animation.left✔️

matrix

Similar to transform-function matrix.

Reference

() => Animation

API Support

APIWeChat Mini-ProgramH5React Native
Animation.matrix✔️

matrix3d

Similar to transform-function matrix3d.

Reference

() => Animation

API Support

APIWeChat Mini-ProgramH5React Native
Animation.matrix3d✔️

opacity

Sets the transparency.

Reference

(value: number) => Animation
PropertyTypeDescription
valuenumberTransparency. It ranges from 0 to 1.

API Support

APIWeChat Mini-ProgramH5React Native
Animation.opacity✔️

Sets the right value.

Reference

(value: string | number) => Animation
PropertyTypeDescription
valuestring | numberLength value. If number is input, px is used by default. Other length values in custom units can be passed.

API Support

APIWeChat Mini-ProgramH5React Native
Animation.right✔️

rotate

Rotates some degrees clockwise from the origin.

Reference

(angle: number) => Animation
PropertyTypeDescription
anglenumberRotation degree value. It ranges from -180 to 180.

API Support

APIWeChat Mini-ProgramH5React Native
Animation.rotate✔️

rotate3d

Rotates the x-axis some degrees clockwise.

Reference

(x: number, y: number, z: number, angle: number) => Animation
PropertyTypeDescription
xnumberX coordinate of the rotational axis
ynumberY coordinate of the rotational axis
znumberZ coordinate of the rotational axis
anglenumberRotation degree value. It ranges from -180 to 180.

API Support

APIWeChat Mini-ProgramH5React Native
Animation.rotate3d✔️

rotateX

Rotates the x-axis some degrees clockwise.

Reference

(angle: number) => Animation
PropertyTypeDescription
anglenumberRotation degree value. It ranges from -180 to 180.

API Support

APIWeChat Mini-ProgramH5React Native
Animation.rotateX✔️

rotateY

Rotates the y-axis some degrees clockwise.

Reference

(angle: number) => Animation
PropertyTypeDescription
anglenumberRotation degree value. It ranges from -180 to 180.

API Support

APIWeChat Mini-ProgramH5React Native
Animation.rotateY✔️

rotateZ

Rotates the z-axis some degrees clockwise.

Reference

(angle: number) => Animation
PropertyTypeDescription
anglenumberRotation degree value. It ranges from -180 to 180.

API Support

APIWeChat Mini-ProgramH5React Native
Animation.rotateZ✔️

scale

Zooms in/out

Reference

(sx: number, sy?: number) => Animation
PropertyTypeDescription
sxnumberZoom in/out the x- and y-axises according to a scale of s if only the sx parameter exists.
synumberZoom in/out the y-axis according to a scale of sy.

API Support

APIWeChat Mini-ProgramH5React Native
Animation.scale✔️

scale3d

Zooms in/out

Reference

(sx: number, sy: number, sz: number) => Animation
PropertyTypeDescription
sxnumberThe scale according to which the x-axis is zoomed in/out.
synumberThe scale according to which the y-axis is zoomed in/out.
sznumberThe scale according to which the z-axis is zoomed in/out.

API Support

APIWeChat Mini-ProgramH5React Native
Animation.scale3d✔️

scaleX

Zooms in/out the x-axis.

Reference

(scale: number) => Animation
PropertyTypeDescription
scalenumberThe scale according to which the x-axis is zoomed in/out.

API Support

APIWeChat Mini-ProgramH5React Native
Animation.scaleX✔️

scaleY

Zooms in/out the y-axis.

Reference

(scale: number) => Animation
PropertyTypeDescription
scalenumberThe scale according to which the y-axis is zoomed in/out.

API Support

APIWeChat Mini-ProgramH5React Native
Animation.scaleY✔️

scaleZ

Zooms in/out the z-axis.

Reference

(scale: number) => Animation
PropertyTypeDescription
scalenumberThe scale according to which the z-axis is zoomed in/out.

API Support

APIWeChat Mini-ProgramH5React Native
Animation.scaleZ✔️

skew

Skews the X- and Y-coordinates.

Reference

(ax: number, ay: number) => Animation
PropertyTypeDescription
axnumberThe angle the x-coordinate is skewed. It ranges from -180 to 180.
aynumberThe angle the y-coordinate is skewed. It ranges from -180 to 180.

API Support

APIWeChat Mini-ProgramH5React Native
Animation.skew✔️

skewX

Skews the x-coordinate.

Reference

(angle: number) => Animation
PropertyTypeDescription
anglenumberSkewed angle. It ranges from -180 to 180.

API Support

APIWeChat Mini-ProgramH5React Native
Animation.skewX✔️

skewY

Skews the Y-coordinate.

Reference

(angle: number) => Animation
PropertyTypeDescription
anglenumberSkewed angle. It ranges from -180 to 180.

API Support

APIWeChat Mini-ProgramH5React Native
Animation.skewY✔️

step

It indicates the completion of a queue of animations. You can call as many animation methods as needed in a queue of animations. All animations in a queue start at the same time, and the next queue of animations will not start until the completion of the current queue.

Reference

(option?: StepOption) => Animation
PropertyType
optionStepOption

API Support

APIWeChat Mini-ProgramH5React Native
Animation.step✔️

top

Sets the top value.

Reference

(value: string | number) => Animation
PropertyTypeDescription
valuestring | numberLength value. If number is input, px is used by default. Other length values in custom units can be passed.

API Support

APIWeChat Mini-ProgramH5React Native
Animation.top✔️

translate

Translate

Reference

(tx?: number, ty?: number) => Animation
PropertyTypeDescription
txnumberIf only this parameter is specified, translate along the x-axis by tx (in px).
tynumberThe distance to translate along the y-axis, in pixels.

API Support

APIWeChat Mini-ProgramH5React Native
Animation.translate✔️

translate3d

Translates the x-, y-, and z-coordinates.

Reference

(tx?: number, ty?: number, tz?: number) => Animation
PropertyTypeDescription
txnumberThe distance to translate along the x-axis, in pixels.
tynumberThe distance to translate along the y-axis, in pixels.
tznumberThe distance to translate along the z-axis, in pixels.

API Support

APIWeChat Mini-ProgramH5React Native
Animation.translate3d✔️

translateX

Translates the x-axis.

Reference

(translation: number) => Animation
PropertyTypeDescription
translationnumberThe distance to translate along the x-axis, in pixels.

API Support

APIWeChat Mini-ProgramH5React Native
Animation.translateX✔️

translateY

Translates the y-axis.

Reference

(translation: number) => Animation
PropertyTypeDescription
translationnumberThe distance to translate along the y-axis, in pixels.

API Support

APIWeChat Mini-ProgramH5React Native
Animation.translateY✔️

translateZ

Translates the z-axis.

Reference

(translation: number) => Animation
PropertyTypeDescription
translationnumberThe distance to translate along the z-axis, in pixels.

API Support

APIWeChat Mini-ProgramH5React Native
Animation.translateZ✔️

width

Sets the width.

Reference

(value: string | number) => Animation
PropertyTypeDescription
valuestring | numberLength value. If number is input, px is used by default. Other length values in custom units can be passed.

API Support

APIWeChat Mini-ProgramH5React Native
Animation.width✔️

Parameters

StepOption

PropertyTypeRequiredDescription
delaynumberNoAnimation delay time (in ms)
durationnumberNoAnimation duration (in ms)
timingFunction"linear" | "ease" | "ease-in" | "ease-in-out" | "ease-out" | "step-start" | "step-end"NoAnimation effect
transformOriginstringNo

timingFunction

PropertyDescription
linearThe animation keeps the same speed from start to end
easeThe animation starts slow, then speeds up, and then slows down before ending.
ease-inThe animation starts at low speed
ease-in-outThe animation starts and ends at low speed
ease-outThe animation ends at low speed
step-startThe first frame of the animation jumps to the end state until the animation ends
step-endThe animation remains the start state until the final frame jumps to the end state

API Support

APIWeChat Mini-ProgramH5React Native
Animation.export✔️
Animation.backgroundColor✔️
Animation.bottom✔️
Animation.height✔️
Animation.left✔️
Animation.matrix✔️
Animation.matrix3d✔️
Animation.opacity✔️
Animation.right✔️
Animation.rotate✔️
Animation.rotate3d✔️
Animation.rotateX✔️
Animation.rotateY✔️
Animation.rotateZ✔️
Animation.scale✔️
Animation.scale3d✔️
Animation.scaleX✔️
Animation.scaleY✔️
Animation.scaleZ✔️
Animation.skew✔️
Animation.skewX✔️
Animation.skewY✔️
Animation.step✔️
Animation.top✔️
Animation.translate✔️
Animation.translate3d✔️
Animation.translateX✔️
Animation.translateY✔️
Animation.translateZ✔️
Animation.width✔️