Jump to content
Search Community

Arifin N

Members
  • Posts

    1
  • Joined

  • Last visited

Posts posted by Arifin N

  1. Hello, how to config magicscroll with tweenmax with requirejs?

    I work with Magento 2, which is Magento 2 using requirejs. 

    I've tried my code in local, it worked. But in magento with requirejs always fail with error in console.

     

    Local (see attachment)

     

    On magento 2 my requirejs config like this:

    var config = {
        paths: {
            'scrollmagic': 'scrollmagic/ScrollMagic.min',
            'bootstrapjs': 'bootstrap/js/bootstrap.min',
            'tweenmax' : 'scrollmagic/plugins/TweenMax.min',
            'timelinemax' : 'scrollmagic/plugins/TimelineMax.min',
            'animationgsap' : 'scrollmagic/plugins/animation.gsap.min',
            'tweenlite' : 'scrollmagic/plugins/TweenLite.min'
        },
        shim: {
            'scrollmagic': {
                'deps': ['jquery']
            },
            'bootstrapjs' : {
                'deps' : ['jquery']
            },
            'tweenmax': {
                'exports': 'tweenmax'
            }
        }
    };

    On page in magento 2 i load like this:

    requirejs([
        'jquery',
        'scrollmagic',
        'tweenmax',
        'timelinemax',
        'animationgsap'
    ], function($,ScrollMagic){
    //code.....
    });

     

    After that on my console always appear error like this: (see attachment).

     

    Is there something wrong with my code? Please help. Thank You.

    Screen Shot 2019-10-18 at 07.49.05.png

    Screen Shot 2019-10-18 at 07.45.10.png

×
×
  • Create New...