scrollmagic

Use gsap with nuxtjs

北慕城南 提交于 2020-01-04 05:41:22
问题 I want to use gsap in combination with ScrollMagic. ScrollMagic is already implemented and it works fine, but when I want to use animation.gsap i get the error These dependencies were not found: * TimelineMax in ./node_modules/scrollmagic/scrollmagic/uncompressed/plugins/animation.gsap.js * TweenMax in ./node_modules/scrollmagic/scrollmagic/uncompressed/plugins/animation.gsap.js Therefore I installed gsap via npm npm i gsap and imported TimelineMax and TweenMax if (process.browser) { const sm

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:

Using JS media queries to change ScrollMagic triggerHook position

笑着哭i 提交于 2019-12-24 13:32:50
问题 How can I successfully reload my scroll magic code and change the triggerHook position? When I try to do it with the code below it sets the trigerHook twice so there are two of them on the screen. My ScrollMagic code goes like this: //Scrollmagic & gsap to move buildings// var controller = new ScrollMagic.Controller(); // build scene first building new ScrollMagic.Scene({ triggerHook: myTriggerHook, triggerElement: "#sec1", duration: $("#sec1").height() + 0 }) .on("enter leave", function() {

Nuxtjs with scrollmagic gives me “window is not defined”

自作多情 提交于 2019-12-24 06:20:42
问题 I want to use scrollmagic with nuxtjs. I installed scrollmagic via npm. npm install scrollmagic In my nuxt.config.js file i added build: { vendor: ['scrollmagic'] }, And in my pages/index.vue file i simply imported it. import ScrollMagic from 'scrollmagic' But this results only in this error [vue-router] Failed to resolve async component default: ReferenceError: window is not defined [vue-router] uncaught error during route navigation: ReferenceError: window is not defined at C:\pathto\node