Jump to content
Search Community

Ahmad Sherazi

Members
  • Posts

    1
  • Joined

  • Last visited

Ahmad Sherazi's Achievements

0

Reputation

  1. Greetings, My code have a timeline which have two instances of another timeline (Moving up timeline) added to it by add function. There is a wheel event which tells me whether the added timeline is active or not. However in the console, active becomes true only for the last instance of timeline and remains false for first instance. It's bit harder to explain, apologies for that however if you see in the code pen example. You will see that when the first image is moving down, and wheel event is triggered it displays false, but for the second it display true. Let me explain the code, kindly forgive me for the fact that it's long but this is the max I could shrink it. 1. LoadImages Function can be ignored as it only load two images and send a promise back so that canvas have loaded both of image. 2. MoveImage function simply draws images on canvas repeadedtly. (This is call in the update function of my MovingDown Timeline for animation). 3. In the then call of my LoadImages function, is the main part where I have made a timeline and adding two instance of moving down timeline in it. (and an event listener of wheel)
×
×
  • Create New...