Week 4: Js Exercise [Ta-Ruedee Pholpipattanaphong (Ploy)]

Link to the walking exercise:  

https://imanas.shanghai.nyu.edu/~trp297/week4/exercise/walking.html

This exercise is really challenging for me. There were many obstacles throughout the process. First of all, I created a separate div for each of the separate images. Thus, it does not line up the image horizontally when I decreased the size, width and height, of the images. After that, I realized I needed to create it in the same div. The CSS part to change the button color wasn’t hard so I head in a do so first. Lastly, the javascript is the one that got me in the most trouble. At first, I didn’t know that we need to set the initial state, which makes the other function impossible. After that, I went into CSS to create the state 0 properties through the different opacities.  Another problem I faced was that I forget to redefine the state such as state = state +1 after I finished state 0, which is why my next if else statement doesn’t work. After knowing the function for state 0 it is kind of similar to the rest of the states. However, when I get to the end of state 2, I don’t know how to make the whole process cycled. After browsing through the internet I found that the state should be set as 0 instead of +1. Even though it is very challenging for me, I obviously learned a lot from the process. 

Leave a Reply