3

在 之间滚动时,活动菜单状态不起作用<section>。scrollMagic 中是否有任何选项可以在滚动时始终设置活动<section>状态.setPin()

var controller = new ScrollMagic.Controller({
  globalSceneOptions: {
    duration: $('section').height(),
    triggerHook: .025,
    reverse: true
  }
});
$("section").each(function() {
    new ScrollMagic.Scene({
        triggerElement: this,
        duration: '50%',
        triggerHook: 0.025,
        reverse: true
    })
    .setPin(this)
    .addTo(controller);
});

演示:http ://codepen.io/mobrndstr/pen/pymGoQ

导航菜单.active状态在滚动时在两个部分之间删除。


<section class="feature" id="intro">.setPin()

在此处输入图像描述


在活动状态消失<section class="feature" id="intro">之间<section class="feature" id="feature">

在此处输入图像描述


状态.active设置<section class="feature" id="feature">setPin()

在此处输入图像描述

4

0 回答 0