6 IMAGE GALLERY REVISITED

What this chapter covers:

  • Removing inline event handlers
  • Building in backwards compatibility
  • Ensuring accessibility

In Chapter 4, we made a JavaScript image gallery. In Chapter 5, we talked about good coding practices. In this chapter, I'm going to apply those practices to the image gallery.

"Question everything" is a good ethos for conspiracy theorists and web designers alike. Whether it's CSS, JavaScript, or visual design, a good web designer will always ask, "Is there a better way of doing this?"

As you saw in the last chapter, the questions relating to DOM scripting are all about graceful degradation, backwards compatibility, and unobtrusive JavaScript. The answers to these questions can affect the usability and ...

Get DOM Scripting: Web Design with JavaScript and the Document Object Model now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.