简体   繁体   English

在 animation 与 Javascript 一起运行后删除 html 标签

[英]Remove html tags after animation is run with Javascript

I have the following HTML code:我有以下 HTML 代码:

<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> .我想从<div>的内容中删除所有<span></span>标签。 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.但是,跨度内的字母每个都出现在交错的.fadeIn() animation 之后,我只想在 animation 完成删除<span>标签。

The final product should be <div>Hello World</div> after the animation has revealed each character.在 animation 显示每个字符之后,最终产品应该是<div>Hello World</div>

JQuery 1.6+ solutions are welcome.欢迎使用 JQuery 1.6+ 解决方案。

http://jsfiddle.net/dsPJu/ http://jsfiddle.net/dsPJu/

here is a working example这是一个工作示例

this should do the trick... you just need to use a callback function这应该可以解决问题...您只需要使用回调 function

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM