Admin Forum:JavaScript help needed

I want the following to happen using JavaScript/jQuery: I predict the code would look something like this for the first bullet point: -- Sam Wang (talk) 11:13, July 15, 2012 (UTC)
 * When id "back" clicked, replace id "projects" with "list-projects"
 * When id "project-1" is clicked, replace id "projects" with "info-1" (repeat this for project-2 and info-2 and so up to 18)
 * Whilst replacing the original thing with the one to replace with when an id is clicked, make the original one fade out, and the new one fade in
 * I want this to be ajax, so please do not reload the page to do it


 * That's a good start. You can use load to fetch data from the server via AJAX. And you can achieve that visual effect with fadeIn and fadeOut. --


 * Thanks! -- Sam Wang (talk) 22:42, July 15, 2012 (UTC)


 * How to combine the fadeIn and fadeOut functions together with the load function? -- Sam Wang (talk) 22:57, July 15, 2012 (UTC)


 * Here was a test code I wrote, but as you can see here, it didn't work:

Sam Wang (talk) 23:03, July 15, 2012 (UTC)

You forgot the parentheses on the second line and there is no element with the ID project-1. --


 * I've just fixed that and added return false to the script, but it won't even load the page, and how to combine the fadeIn and fadeOut styles with the load function? -- Sam Wang (talk) 23:35, July 15, 2012 (UTC)