I can't seem to find what I'm doing wrong. I want the div named "numberedpagecontainer" to fade out when I click the image I gave the id "click", which brings me back to my index.html.
The image is inside an anchor with an href attribute, and of course, clicking the link brings you to the link reference (in this case index.html). You need to assign the onclick event handler to the link and tell it to not perform the default action. You can do this with:
The default action of a link on click is to bring you to the referenced file (i. e. in your case to the index page). However, you didn’t specify that you actually wanted to fade out that div and then go to the page specified in the link. What happens is that when you click the link it loads the new page immediately so you never see the fade-out occur. What you want is the fade-out and after that’s done go to the specified page.
Therefore your code needs to look something like this:
The code explained: When clicking the link it prevents the browser from loading the index page initially and just fades out the div. After that’s done it loads the page.