Modify ch9_example6.html from the Animating Content Try It Out so that the amount of pixels moved in either direction is
Modify ch9_example6.html from the “Animating Content” Try It Out so that the amount of pixels moved in either direction is controlled by a global variable. Call it direction. Remove the switchDirection variable, and change the code to use the new direction variable to determine when the animation should change directions.
This problem has been solved!
Step by Step Answer: