Everything posted by maxxheth
Yeah, fair enough! I guess I just wanted to be able to switch back and forth between being able to target single elements and multiple elements on a whim, but your event emitter / data attribute solution works perfectly for that as well.
Thanks Blake! That's pretty handy! I like how you used the event emitter plugin and data attributes to toggle the tween for the whole set. Yeah, not looping when you don't have to is def ideal.
Actually, I managed to figure it out. I tried working it out in the code itself, but the easiest way is to just to target each element through its own class or ID and and run it through each function individually. Since each element will reside in its own array, the reverse / toggle logic will only apply to the element inside that array. Maybe there's a better way (I'm always open to suggestions!), but this will work for my purposes. =)
@OSUblake Is there a way to toggle items individually without reversing other elements that have already been triggered?
Thanks @OSUblake! Nice ES6 implementation.
Hey everyone! So I realize this thread is really old, but I was messing around with Blake's implementation of the jQuery / TweenLite animation toggle last night and ended up rewriting it in vanilla JS in case anyone's interested in using that instead of jQuery for whatever reason: