http://imanas.shanghai.nyu.edu/~shl620/week4/
I had a bit of trouble with the button at first because I forgot to link it to my JavaScript file. I also had to change the names of the .css and .js files since I usually use “style.css” and “script.js” but the files in the folder were named “styles.css” and “scripts.js”.
At first, I wanted to see if I could get the images by using document.getElementById(“id”).innerHTML to get the file name. I never tried it, but I don’t think it would work. After realizing that we were meant to change the opacity it was much easier to figure out how to cycle through the pictures. When the script.js wasn’t working due to me not linking it I was searching up how to change the opacity since I thought that was the problem. While doing so I found someone using variables which I why I added that to my JavaScript. Although I do know how to do it without variables I think it makes it look nicer and it’s probably better to use variables when I get to longer projects anyways.