Div SlideInLeft,停止3秒,然后SlideOutRight(Div SlideInLeft, Stop for a 3 Sec, then SlideOutRight)

编程入门 行业动态 更新时间:2024-10-11 03:20:24
Div SlideInLeft,停止3秒,然后SlideOutRight(Div SlideInLeft, Stop for a 3 Sec, then SlideOutRight)

我正在学习Dan Eden精彩的animate.css中的 css过渡动画。我需要创建一个slideinleft的div,停在页面的中心几秒钟,然后是SlideOutRight。

请检查这个小提琴 。 我试图删除该类并将其替换为新类。

setTimeout(function() { $("div.slideLeft").removeClass("slideLeft").addClass("slideOutRight"); }, 1000);

谢谢

I'm learning css transition animation from Dan Eden’s wonderful animate.css I need to create a div that slideinleft, stop at the center of the page for a few seconds, then SlideOutRight.

Please check this fiddle. I tried to remove the class and replace it with the new one.

setTimeout(function() { $("div.slideLeft").removeClass("slideLeft").addClass("slideOutRight"); }, 1000);

thank you

最满意答案

您的示例中缺少的一个重要事项是animation-fill-mode CSS属性。 它指定CSS动画在执行之前和之后应如何将样式应用于其目标。

阅读有关animation-fill-mode Mozilla Developer Network的更多信息 。

看看工作小提琴 。

An important thing missing in your example is animation-fill-mode CSS property. It specifies how a CSS animation should apply styles to its target before and after it is executing.

Read more about animation-fill-mode Mozilla Developer Network.

Check out the working Fiddle.

更多推荐

本文发布于:2023-07-30 15:24:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1338757.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:SlideInLeft   Div   SlideOutRight   Sec   Stop

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!