【问题标题】:Display Scroll Reveal Animation after each other依次显示滚动显示动画
【发布时间】:2019-08-08 05:10:05
【问题描述】:

我正在使用这个模板:https://startbootstrap.com/template-overviews/creative/ 和插件 jQuery Scroll Reveal

如果你看这个页面:https://blackrockdigital.github.io/startbootstrap-creative/#services

动画(钻石、纸飞机、报纸和心脏)依次加载。当数字 1 完成等时,图标 2 开始动画。

当我尝试做同样的事情时,所有动画都会同时加载。

JavaScript(刚刚在模板中添加了.sr-step

// Initialize and Configure Scroll Reveal Animation
window.sr = ScrollReveal();
sr.reveal('.sr-icons', {
    duration: 600,
    scale: 0.3,
    distance: '0px'
}, 200);
sr.reveal('.sr-button', {
    duration: 1000,
    delay: 200
});
sr.reveal('.sr-step', {
    duration: 600,
    delay: 200
});
sr.reveal('.sr-contact', {
    duration: 600,
    scale: 0.3,
    distance: '0px'
}, 300);

这是我的html

                <div class="row">
                    <div class="col-lg-3 col-md-6 sr-step">
                            <h3 class="step-number">01</h3>
                           <div class="step-text"><p>Text text text text.</p>
                       </div>
                   </div>
                   <div class="col-lg-3 col-md-6 sr-step">
                        <h3 class="step-number">02</h3>
                       <div class="step-text">Text text text text.</div>
               </div>
                    <div class="col-lg-3 col-md-6 sr-step">
                        <h3 class="step-number">03</h3>
                       <div class="step-text">Text text text text.</div>
               </div>
               <div class="col-lg-3 col-md-6 sr-step">
                    <h3 class="step-number">04</h3>
                 <div class="step-text">Text text text text.</div>
         </div>
     </div>

【问题讨论】:

    标签: javascript jquery scrollreveal.js


    【解决方案1】:

    在定序器大修期间,很明显interval 参数的可选性质造成了不必要的混乱。它现在与所有其他选项一起使用。

    // v3
    window.sr = new ScrollReveal();
    sr.reveal('.tile', { reset: true }, 16);
    
    // v4
    ScrollReveal().reveal('.tile', { reset: true, interval: 16 });
    

    source

    【讨论】:

      【解决方案2】:

      200发现延迟

      sr.reveal('.sr-icons', {
          duration: 600,
          scale: 0.3,
          distance: '0px'
      }, 200);
      

      【讨论】:

        猜你喜欢
        • 2021-12-10
        • 1970-01-01
        • 2013-09-14
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多