Search the Community
Showing results for tags 'reverse timeline'.
-
Hi all, Been a while Working on a project with a fullpage menu. On that menu I've got a line under each menu link which gets triggered on hover via the following statement. Unfortunately when I click any of said links and go to another page, when you open the menu again the corresponding line from the previous page is still visible. Obviously that hover out does not trigger due to the cursor not moving off the menu element, so we have to somehow do it via click. One would think you could just check if the animation is reversed on click, if not reverse it... however no cigar as of yet. https://codepen.io/wsdesign/project/editor/XveMOR Hopefully someone can see what's going wrong! Cheers, Smallio $(".menu-link-wrap").each(function(i, element) { var tl = new TimelineMax({paused:true, reversed:true}); var menuHoverLine = $(this).find(".menu-hover-line"); tl.fromTo(menuHoverLine, 0.4, { scale:0 }, { scale:1, transformOrigin: "center", ease:Power1.easeInOut }); function toggleReverse () { if (tl.reversed() === false) { tl.reverse(); } else { console.log("already reversed") } } $(element).hover(menuLinkHover, menuLinkHover); $(element).click(toggleReverse); function menuLinkHover() { tl.reversed() ? tl.play() : tl.reverse(); } });
- 11 replies
-
- each
- reverse timeline
-
(and 1 more)
Tagged with:
-
I've been trying to create an accordion menu with GSAP. I have 3 menus and I want the others to reverse their animations when one is clicked. Each menu item also has a hover state.. which I think is causing my issue. If you click around on the menu items quickly, then sometimes an element is left with it's old boxshadow property. If you check out the codepen I think you'll get a good idea of what I'm talking about. Is there a better way to do what I'm trying to do?
- 4 replies
-
- reverse timeline
- menu
-
(and 1 more)
Tagged with:
-
import com.greensock.TimelineMax; function cabrasP(event:MouseEvent):void { if(mc_pan.currentFrame < 49) { mc_pan.play(); } else if (mc_pan.currentFrame > 49) { mc_pan.timeline.reverse(); } } i have this but my mc cant, play in reverse, what can i do?