Scrollmagic duration

只愿长相守 提交于 2020-01-04 00:39:07

问题


Is there a way to set the scrollmagic duration on a scene as long as the height of the scene? I want to use the class toggles functionality and certain scenes are heigher than the viewport height.

<section id="sec1">I'm 400px in height</section>
<section id="sec1">I'm 100% in height (1 viewport)</section>
<section id="sec1">I'm 2500px in height (2,2 viewports)</section>

Duration in px: {duration: 400}

Duration in vh: {duration: '100%'}

Duration in element height: ???

Thanks for helping!


回答1:


Try using $("#sec1").height() in the duration option.



来源:https://stackoverflow.com/questions/39268491/scrollmagic-duration

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!