Week 07: Assignment – Gallery

This Week’s Lecture



Create a JavaScript image gallery from the Assignment Template (zip)
You can use these images (or your own).

Simple Demo

Complex Demo

Image links (the unordered links list) should change the src attribute of the image within the div with the id of “main_image” using onclick event (you can use addEventSimple or traditional event binding methods)

Tools you will need:

  • Lecture 07: The DOM
  • addEventSimple if desired
  • DOM Manipulation–using document.getElementById()


Remember that you must prevent the default action upon clicking the link using “return false”, otherwise, the href will continue as the browser expects, pushing the user off the page.

Extra Credit

Spice up your image gallery with extra CSS styling, unobtrusive JavaScript, thumbnail rollovers, image preloading, add lightbox, etc…

Publish this page on your Assignments Page by next week’s lecture

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Web Development Courses, Rants, Tutorials and Hacks