如何使用animate.css在barba js中设置过渡持续时间

时间:2018-07-25 09:25:47

标签: javascript jquery css

我正在使用barba.js进行页面过渡,还使用animate.css进行了过渡,我试图设置过渡的持续时间,但是该功能忽略了持续时间。

Main.js

  fadeIn: function() {
    /**
     * this.newContainer is the HTMLElement of the new Container
     * At this stage newContainer is on the DOM (inside our #barba-container and with visibility: hidden)
     * Please note, newContainer is available just after newContainerLoading is resolved!
     */

    var _this = this;
    var $el = $(this.newContainer);


        // the 300 doesn't work, it ignores it. the transition works, but it ignores the transition duration

        $el.animateCss('fadeInUp', 300, function() {

          /**
           * Do not forget to call .done() as soon your transition is finished!
           * .done() will automatically remove from the DOM the old Container
           */

          _this.done();
        });
      }
    });

1 个答案:

答案 0 :(得分:0)

document.getElementById("myDIV").style.transitionDuration = "300ms";