如何在部分之间滚动时保持菜单活动状态

时间:2016-05-18 10:09:47

标签: javascript scroll tweenmax scrollmagic superscrollorama

<section>之间滚动时,活动菜单状态无效。在基于<section> .setPin() {?}}进行滚动时,scrollMagic中是否有任何选项可以始终设置活动状态?

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()

enter image description here

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

enter image description here

.active statu <section class="feature" id="feature">已设为setPin()

enter image description here

0 个答案:

没有答案