开发者

Remove html tags after animation is run with Javascript

开发者 https://www.devze.com 2023-03-27 13:02 出处:网络
I have the following HTML code: <div> <span>H</span> <span>e</span> <span>l</span>

I have the following HTML code:

<div>   
    <span>H</span>
    <span>e</span>
    <span>l</span>
    <span>l</span>
    <span>o</span>

    <span>W</span>
    <span>o</span>
    <span>r</span>
    <span>l</span>
    <span>d</span>
</div>

I want to remove all of the <span> and </span> tags from the contents of the <div>. However, the letters within the span are each appearing after a staggered .fadeIn() animation and I only want to remove the <span> tags after the animation is complete.

The final product should be <div>Hello World</div> after the animation has revealed each character.

开发者_JAVA技巧

JQuery 1.6+ solutions are welcome.


http://jsfiddle.net/dsPJu/

here is a working example

this should do the trick... you just need to use a callback function

0

精彩评论

暂无评论...
验证码 换一张
取 消