滚动魔术 - 不适用于移动设备

时间:2016-02-10 10:11:21

标签: jquery scrollmagic

我们最近开始在我们的一个项目中使用ScrollMagic。它在台式机上运行良好。我们开始在平板电脑和移动设备上进行测试,并且它最初工作。然而,当向上滚动到页面顶部时,滚动魔术富矿发生的元素消失并留下很大的空间。这是我们当前的代码:

function scrollMagic() {
    // init controller
    var controller = new ScrollMagic.Controller();

    // build scene
    var scene1 = new ScrollMagic.Scene({ duration: 600 })
        .setTween(".splash", {y: - x } ) // the tween durtion can be omitted and defaults to 1
        // .addIndicators({name: "splash (duration: 600)"}) // add indicators (requires plugin)
        .addTo(controller);

    var scene2 = new ScrollMagic.Scene({ duration: 340 })
        .setTween(".brand", {y: x/2 } ) // the tween durtion can be omitted and defaults to 1
        // .addIndicators({name: "brand (duration: 300)"}) // add indicators (requires plugin)
        .addTo(controller);
}

scrollMagic();
$(window).resize(scrollMagic);

有关如何解决此问题的任何想法?我错过了什么吗?

0 个答案:

没有答案
相关问题