首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Animate.css延迟动画,如何使用animate.css创建幻灯片

Animate.css延迟动画,如何使用animate.css创建幻灯片
EN

Stack Overflow用户
提问于 2017-02-04 19:36:05
回答 1查看 1.1K关注 0票数 0

我有个小问题..我确信它已经解决了,但我已经能够看到它上面的任何堆栈溢出解决方案。所以我不想问

我在视频上创建幻灯片,我想让幻灯片滚动进去,幻灯片没有图像,只有标题

我正在使用animate.css和jquery,问题是我似乎不能对我的幻灯片进行计时,以使观众能够在下一张幻灯片离开之前阅读它,另一个问题是我无法获得下一张幻灯片

以下是代码

代码语言:javascript
复制
 <!--==========Video area==========-->
     <section>
<div class="content">
     <video autoplay="autoplay" muted="muted" loop="loop">
        <source src="view.mp4" type="video/mp4">
    </video>
<div class="content-slide">
    <h1>HESI-GEOMATICS</h1>
    <p>the Earth Brings life</p>
</div>               
<div class="content-slide">
    <h1>HELLO</h1>
    <p>Welcome to our site</p>
</div>       
  <div class="content-slide">
    <h1>GEOMATICS</h1>
    <p>Join Us</p>
</div>         
    </section>
    <!--==========End Video area==========-->

现在我的CSS代码

代码语言:javascript
复制
.content {
position: relative;
width: 100%;
}
.content:before {
/*Note: z-index of 1 or 0 can be used here*/
content: '';
position: absolute;
background: rgba(31, 26, 23, 0.7);
/*background: rgba(93, 171, 217, 0.3);*/
/*
Note: Valid code (color HesiBlue: #5DABD9)
background-color: #1F1A17;
opacity: 0.4;
filter: alpha(opacity=40);*/
top: 0;
right: 0;
bottom: 0;
left: 0;
}

 .content-slide {
position: absolute;
width: 100%;
left: 50%;
top: 50%;
-webkit-transform:translateX(-50%) translateY(-50%) ;
-ms-transform: translateX(-50%) translateY(-50%);
transform: translateX(-50%) translateY(-50%);
/*min-height: 100%;*/
z-index: 1;
   /* background-color: rgba(0,0,0,0.7);*/
}
  .content-slide h1 {

text-align: center;
font-size: 65px;
text-transform: uppercase;
font-weight: 300;
color: #fff;
   /* padding-top: 15%;
    margin-bottom: 10px;*/
    -webkit-animation-duration: 1.5s;
     -webkit-animation-delay: 1s;
     /*-webkit-animation-iteration-count: infinite;*/
    }
    .content-slide p {
    text-align: center;
    font-size: 20px;
    letter-spacing: 3px;
    color: #aaa;
    -webkit-animation-duration: 1.5s;
    -webkit-animation-delay: 1.5s;
    /*-webkit-animation-iteration-count: infinite;*/
    }

我的JQuery是

代码语言:javascript
复制
 $(function(){
        /*Declarations*/

    var animationEnd = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend';
    var contentH1 = ".content-slide h1";
    var contentP = ".content-slide p";

    /* reason we use one() instead on on() will only listen to the event once and then it will unbind itself */
    $(window).on( "load", function(){

        $(contentH1).addClass('animated bounceInLeft');

        $(contentP).addClass('animated bounceInRight').one(animationEnd,
            function() {
            $(this).removeClass('animated bounceInRight');

           // event.stopPropagation();
        });
    });
});

如何延迟我的动画我在jquery中尝试了.delay(15000),但它没有用

EN

回答 1

Stack Overflow用户

发布于 2017-09-30 01:12:07

尝试将CSS规则"animation-delay: 3s;“应用于应用了animate.css类的元素。

例如,如果html元素<img src="..." class="animated flash">应用了animate.css,则应用

代码语言:javascript
复制
img{
animation-delay: 3s;
}

要将动画延迟3秒,请执行以下操作。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/42039888

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档