Chapter 6. The Image Gallery Revisited

What this chapter covers:

  • Removing inline event handlers

  • Building in backward 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, backward compatibility, and unobtrusive JavaScript. The answers to these questions can affect the usability ...

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

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.