I am working on a rather complex jquery-to be animation which moves various div's based on different trigger events. To simplify the scenario I am trying to solve, see the following:
- I have DIV 1 and DIV 2 on the screen
- DIV 1 needs to animate from position A to position B
- DIV 2 needs to also animation from position C to position D, however ONLY when DIV 1 reaches position B.
How should I get around doing something like this?
I am thinking I need to use a trigger/event listener mechanism, were DIV 2 goes to sleep, and only gets woke up by an event that gets triggered when DIV 1 reaches position B on the screen.
Is this the best mindset I should have? How do I do this using jQuery.
Much appreciated.