Change text (html) with .animate

后端 未结 7 2095
灰色年华
灰色年华 2020-12-23 20:04

I am trying to animate the html part of a tag ( This Text! ) using jQuery\'s Animate function, like so:

7条回答
  •  再見小時候
    2020-12-23 20:18

    The animate(..) function' signature is:

    .animate( properties, options );
    

    And it says the following about the parameter properties:

    properties A map of CSS properties that the animation will move toward.

    text is not a CSS property, this is why the function isn't working as you expected.

    Do you want to fade the text out? Do you want to move it? I might be able to provide an alternative.

    Have a look at the following fiddle.

提交回复
热议问题