joelkrause
8/20/2019 - 9:07 AM

On scroll animate items in using tweenmax and scrollmagic. Apply an ID to the div (can use rand() + something else) Add class of .animated

On scroll animate items in using tweenmax and scrollmagic. Apply an ID to the div (can use rand() + something else) Add class of .animated to that div. Voila

var controller = new ScrollMagic.Controller();  

$('.animated').each(function () {
    _this = $(this);
    _thisId = _this.attr('id');
    _trigger = '#' + _thisId;
    _offset = $(this).outerHeight() / 3 + 100;
    var scene = new ScrollMagic.Scene({
        triggerElement: _trigger,
        triggerHook: "onEnter",
        offset: 75,
        duration: 0,
        reverse: true,
    }).setTween(_trigger, .5, {
        opacity: '1',
        ease: Power0.easeOut,
        delay: 1
    }).addTo(controller);
});