我尝试使用Scrolltomagic在激活触发器时滚动部分。
var sceneOptions2 = {duration: 500};
var divfocus = $("div.wrapper section");
当该部分被激活时,它应该到达页面顶部。 但滚动donts工作。
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:任何关于优化我的代码的建议,也许是一种干净的方式