janpaepke / ScrollMagic

The javascript library for magical scroll interactions.
http://ScrollMagic.io
Other
14.88k stars 2.17k forks source link

Superscrollarama to scrollmagic #482

Open supermoney1709 opened 8 years ago

supermoney1709 commented 8 years ago

I am not sure how to turn my superscrollarama code into scrollmagic i tried reading docs but it did not help. With superscrollarama i could not TARGET an array of html classes i would get an error. i want to upgrade to scrollmagic but not sure how to change my code:

jQuery(function ($) {
    $(document).ready(function () {
        var controller = $.superscrollorama();
        var className = ['.foot_l_1', '.foot_l_2', '.foot_l_3', '.foot_r_1', '.foot_r_2', '.foot_r_3']
        controller.addTween(className, TweenLite.from(className, .90, {
            css: {
                opacity: 0
            },
            ease: Quad.easeInOut
        }));
    });
});
Ihatetomatoes commented 8 years ago

You are using jQuery, so the easiest way is to wrap the className in $('className').

Here is an example on CodePen.

Hope that helps.

supermoney1709 commented 8 years ago

Thanks so much!