Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tween was overwritten by another #9

Open
niklasgrewe opened this issue Mar 12, 2020 · 2 comments
Open

tween was overwritten by another #9

niklasgrewe opened this issue Mar 12, 2020 · 2 comments

Comments

@niklasgrewe
Copy link

I am using scrollmagic and gsap in svelte component like this:

//Hero Component
<script>
   import { onMount } from 'svelte'
   import ScrollMagic from 'scrollmagic'
   import { TweenMax } from 'gsap'
   import { ScrollMagicPluginGsap } from "scrollmagic-plugin-gsap";

   ScrollMagicPluginGsap(ScrollMagic, TweenMax);

   let imgContainer;
   let image;

   onMount(() => {
        TweenMax.defaultOverwride = false;
        var controller = new ScrollMagic.Controller();
        var imageScene = new ScrollMagic.Scene({
            offset: 0,
            duration: 500
        })
            .setTween(TweenMax.fromTo(imgContainer, 0.2, {scale: 2.1}, {scale: 1, overwrite: false}))
            .addTo(controller);
    })
</script>

<div bind:this={imgContainer}>
  <img bind:this={image} src="/path/to/image" />
</div>

I load the Component like this:

<script>
	import { onMount } from 'svelte';

	let MyComponent;

	onMount(async () => {
		const module = await import('my-non-ssr-component');
		MyComponent = module.default;
	});
</script>

<svelte:component this={MyComponent} foo="bar"/>

So but when i start scrolling i get the error: tween was overwritten by another
I know the scrollmagic guide about this but the solutions doesn't work in my environment.

Any ideas, how can i fix that?

@niklasgrewe
Copy link
Author

niklasgrewe commented Mar 14, 2020

@epranka Update:
the error seems to be related to GSAP3 When I use GSAP version 2, I don't get this warning...

@WisdomSky
Copy link

any updates?

tagging @epranka

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants