Hi there,
I'm new to the forums, let me know if this is the wrong place for this topic.
Anyway, I have a navigation menu with a few links, each link has children links. I'm animating the left position of the parent wrapper and the children wrapper.
It works fine the first time, but as soon as the timeline has completed I can't redo the same animation...
I want to be able to toggle between the two states.
Here is my js
var tl = new TimelineMax();
$('.panel > ul > li > a').on('click', function() {
var pa = $('.panel > ul > li > a');
var ch = $(this).siblings('ul');
tl
.to(pa, .3, {left: '-100%'}, 'left')
.to(ch, .3, {left: '0%'}, 'left');
});
$('a.return').on('click', function() {
var ch = $(this).closest('ul');
var pa = $('.panel > ul > li > a');
tl
.to(pa, .3, {left: '0%'}, 'right')
.to(ch, .3, {left: '100%'}, 'right');
});
Any help is appreciated.