Cracks 发表于 2017-6-27 20:29:27

使用swiper给一个元素添加两个动画的问题

<img class="ani" id="yun" data-slide-in="at 3000 from shuye use swing during 1000" src="/images/b2.png"/>

var mySwiper = new Swiper('.swiper-container',{
    direction : 'vertical',
    onInit: function(swiper){ //Swiper2.x的初始化是onFirstInit
      swiperAnimateCache(swiper); //隐藏动画元素
      swiperAnimate(swiper); //初始化完成开始动画
    },
    onSlideChangeEnd: function(swiper){
      swiperAnimate(swiper); //每个slide切换结束时也运行当前slide动画
      switch(mySwiper.realIndex){
            case 0:break;
            case 1:setTimeout(function(){
               document.getElementById("yun").style.animation="1s ease 0s normal both infinite running bounce";
            },4500);break;
      }
    }

})

这里使用了官网首页推荐的添加两种动画的方式,发现不行以后就找了一种方法如下面JS所示,但是第一个动画执行完了以后 第二个动画
貌似不执行而是直接给元素搞没了,有大神知道什么情况吗?求教

Cracks 发表于 2017-6-27 21:01:32

现在元素消失的问题解决了,是我自己css位置设置的有问题,但是这个样子,动画还是无法执行第二个

lyace 发表于 2017-6-29 10:05:15

如何获取金币如何获取金币如何获取金币如何获取金币

lsx-pp 发表于 2017-7-4 09:41:57

1111111111
页: [1]
查看完整版本: 使用swiper给一个元素添加两个动画的问题