Jump to content
Search Community

getting error when trying to add Scrollmagic using require js

Hari t test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Hi,

 

In our magento project, we need to add scroll magic animations. we used the following code to include libraries:

 

requirejs-config.js:

 

var config = {

    paths: {
        "TweenMax" :            "js/TweenMax.min",
        "scrollMagic" :            "js/ScrollMagic",

        "animation.gsap" :            "js/plugins/animation.gsap"



    },
    deps: [

    ],

    "shim": {
        /*"wc_owlCorousel" : {
            "deps" : ['jquery']
        }*/

         "TweenMax" :         {

            exports: 'TweenMax',
        },
        "scrollMagic" :         {
            exports: 'scrollMagic',
        },
        "animation.gsap" :         {
            exports: 'animation.gsap',
        },





    }
};

 

And in library files placed in the respective folders.

Then, we added this code in our html page:

 

requirejs(['jquery','scrollMagic'], function ($,ScrollMagic) {
   ...............
   .................
    
    

 

But when running we get this error:

 (ScrollMagic.Scene) -> ERROR calling setTween() due to missing Plugin 'animation.gsap'. Please make sure to include plugins/animation.gsap.js.

 

We tried some alternatives such as :

 

requirejs(['jquery','scrollMagic', 'TweenMax'], function ($,ScrollMagic, TweenMax) {
  ..........................
}

 

But nothing is woked. Please let me know how to include scroll magic and  green sock in magento (or in require js)

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...