Jump to content
Search Community

Text div show and hide

Generic1 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,

Iam working with TweenMax and I would have a question concerning animation of my menu.
The code below shows my current behaviour: I have text- blogs and if the use scrolls down than the text blogs
move up to become the menu of the page.

My problem now is, that I dont know how to show "menuItems" again (when scrolling up) after I have hide it with scrolling down.

Thanks a lot for help and maybe hints to improve the code above.

 

Generic

<script>
           $(document).ready(function() {
                    var controller = $.superscrollorama({
			triggerAtCenter: true,
			playoutAnimations: false,
                        autoRemoveChildren : true
		});
            
                    controller.pin($('#headMenu'), 800, {
                        anim: (new TimelineLite())
                          .append([
                            TweenMax.fromTo($('#move-it3'), 6.0, 
                              {css:{left: "1%", top: 480, color:"#fff", fontSize: "1.8em"}, immediateRender:true}, 
                              {css:{top: 0, left: "+=150px", color:"#fff", fontSize: "1.3em"}
                            })
                          ])
                          .append([
                            TweenMax.fromTo($('#move-it2'), 10.0, 
                              {css:{left: "8%", top: 130, color:"#fff", fontSize: "1.8em"}, immediateRender:true}, 
                              {css:{top: 0, left: "+=55px", color:"#fff", fontSize: "1.3em"}}),
                            TweenMax.fromTo($('#move-it1'), 4.0, 
                              {css:{left: "14%", top: 340, color:"#fff", fontSize: "1.8em"}, immediateRender:true}, 
                              {css:{top: 0, left: 185, color:"#fff", fontSize: "1.3em"},  
                             })
                          ])
                         .append([
                            TweenMax.fromTo($('#move-it'), 14.0, 
                              {css:{left: "4%", top: 470, color:"#fff", fontSize: "1.8em"}, immediateRender:true}, 
                              {css:{top: 0, left: "+=70px", color:"#fff", fontSize: "1.3em"},
                              onComplete: function() {
                                 $('.menuItem').hide();
                                },
                              onStartListener: function() {
                                  alert('onStartListener');
                                } 
                            })
                         ]),
                      onComplete: function() {
                            }
                      });
                      
                   $(window).resize(function () {
                    controller.triggerCheckAnim();
                    });
            });
    </script>
Link to comment
Share on other sites

Hi and welcome to the GreenSock forums,

 

It appears this question is tightly related to how Superscrollorama works and triggers animations. You could try posting an issue on the SuperScrollorama github repository. However, I don't think that library is actively maintained anymore. The author recommends you switch over to ScrollMagic which is pretty much SuperScrollorama 2.0 but built from scratch by another developer. We've seen great results from ScrollMagic.

 

Check it out here: http://janpaepke.github.io/ScrollMagic/

Seek help here: https://github.com/janpaepke/ScrollMagic/issues

 

Our expertise is in our own tools and we really don't know all that much about all the third party tools that tap into GSAP.

 

I'm confident though that what you are trying to do should be pretty easy with ScrollMagic.

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...