Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The CSS property set in jQuery animate ()

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article introduces the relevant knowledge of "CSS attribute set in jQuery animate ()". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

The animate () method performs a custom animation of the CSS property set.

This method changes an element from one state to another through the CSS style. The value of the CSS property changes gradually so that you can create an animation effect.

Only numeric values can create animations (such as "margin:30px"). String values cannot create animations (such as "background-color:red").

Tip: use "+ =" or "- =" to create relative animation.

Syntax:

(selector) .animate ({styles}, speed,easing,callback)

The required description styles for the parameter is

Specifies one or more CSS attributes / values that produce animated effects.

Note: when used with the animate () method, the property name must be written as a hump: you must use paddingLeft instead of padding-left,marginRight instead of margin-right, and so on.

You can apply the attributes of the animation:

BackgroundPositionX

BackgroundPositionY

BorderWidth

BorderBottomWidth

BorderLeftWidth

BorderRightWidth

BorderTopWidth

BorderSpacing

Margin

MarginBottom

MarginLeft

MarginRight

MarginTop

OutlineWidth

Padding

PaddingBottom

PaddingLeft

PaddingRight

PaddingTop

Height

Width

MaxHeight

MaxWidth

MinHeight

MinWidth

FontSize

Bottom

Left

Right

Top

LetterSpacing

WordSpacing

LineHeight

TextIndent

Tip: color animation is not included in the core jQuery library. If you want to apply animated colors, you need to download the color animation plug-in from jQuery.com.

Speed No

Specifies the speed of the animation.

Possible values:

Millisecond

"slow"

"fast"

Easing No

Specifies the speed of elements at different points in the animation. The default is "swing".

Possible values:

"swing"-move slowly at the beginning / end and fast in the middle

"linear"-moving at a uniform speed

Tip: more easing functions are available in the extension.

Callback No

The function to be executed after the animate function has been executed.

To learn more about callback, please visit our jQuery Callback chapter.

Jq tutorial / / this version is Baidu cdn 1.11.1. Of course, you can use a higher version. Ie6-8 is not supported from version 2.0 or above.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report