0

当触发器被激活时,我尝试使用 Scrolltomagic 滚动部分。

var sceneOptions2 = {duration: 500};
var divfocus = $("div.wrapper section");

当该部分被激活时,它应该上升到页面的顶部。但滚动不工作。

new ScrollScene(sceneOptions2)
.addTo(controller)
.triggerHook("onCenter")
.triggerElement(divfocus[1])
.setTween(TweenMax.to(divfocus[1], 2, {scrollTo:{y:50}, ease:Back.easeOut}));

当它被触发器激活时,如何使该部分进入顶部?

完整代码:http: //jsfiddle.net/thallysondias/14ktjsb7/4/


ps:任何优化我的代码的建议,也许是一种干净的方式

4

1 回答 1

1

ScrollMagic 是一个滚动交互插件,而不是滚动顶插件。
要在滚动位置强制中断,请使用fullPageOnePageScroll

完整答案在这里:https ://github.com/janpaepke/ScrollMagic/issues/234

于 2015-01-31T10:26:14.933 回答