在 之间滚动时,活动菜单状态不起作用<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()