在 ScrollMagic 中激活触发器时将部分滚动到顶部
Scroll Section to top when active trigger in ScrollMagic
我尝试在激活触发器时使用 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:关于优化我的代码的任何建议,也许是一种干净的方式
ScrollMagic 是一个滚动交互插件,而不是滚动顶升插件。
要在滚动位置强制中断,请使用 fullPage or OnePageScroll.
我尝试在激活触发器时使用 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:关于优化我的代码的任何建议,也许是一种干净的方式
ScrollMagic 是一个滚动交互插件,而不是滚动顶升插件。
要在滚动位置强制中断,请使用 fullPage or OnePageScroll.