Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript How do I append/add to a tween timeline?

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #148514
    nixnerd
    Participant

    So, I’ve been messing around with the Greensock tweening engine and I have one snippet of code that I CANNOT figure out to save my life.

    I’ve been messing around with it for days.

    Here is my full script:

    <script>
        $(document).ready(function() {
            var controller = $.superscrollorama();
    
            //This code snippet is built on the parallax example:
    
            controller.addTween(
                '#gun',
                (new TimelineLite())
                    .append([
                        TweenMax.fromTo($('#hammer'), 1, 
                            {css:{rotation: 0}, immediateRender:true}, 
                            {css:{rotation: -25}, ease:Quad.easeInOut}),
                        TweenMax.fromTo($('#trigger'), 1, 
                            {css:{rotation: 0}, immediateRender:true}, 
                            {css:{rotation: 40}, ease:Quad.easeInOut})
                        ]),
                        500, // scroll duration of tween
                        200); // offset?
    
            });
    </script>
    

    How do I add a tween after the one I already have? Seems simple enough but I can’t do it!

    Please help. Thanks!

Viewing 1 post (of 1 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.