I’m going to kick off a new weekly series this week I’m calling “The Basics”; Here’s the idea:
Over time, I might pick up a new technique that helps me solve feature X in a better way, but I’m not going to go back over twenty different sites and figure out how to massage the improvement into each one’s code.
- Maximize separation of behavior, presentation, and markup.
- Work across as many browsers as possible.
- Degrade gracefully.
- Play well with others.
- Minimize configuration.
I should be able to just drop the script on the page and watch it work. Binding will be handled via CSS classes in much the same way that presentation is applied.
For the first week, I’m starting off with an easy one, but one that gets used all the time: image rollovers. We’ve been doing these since M.C. Hammer was cool and Netscape roamed the earth, but here’s the no-fuss 2006 approach.