(Actually useful) Javascript

I’m completely on the fence when in comes to javascript. I like the idea of implementing extra whirly gigs that make sites more usable and behave more like desktop applications, but bloat is bloat and if poorly implemented javascript can quickly blow apart your design into something completely unusable.

To make things even more complicated, I am a bit of a javascript moron. This is well documented. I won’t regale you with stories of my idiocy - suffice to say that as a result I demand that javascript is simple, easy to use and degrades gracefully.

I find javascript particularly useful to make up for the shortcomings of IE6 and that is what this post is mostly about.

Anyhow, I’ve started to use a few bits of javascript regularly and here’s my top 3 list –

Suckerfish (CSS/js dropdowns)

by htmldog.com

I first came across Suckerfish on A List Apart, but since that post they’ve gone back and made their code even better. Now, with just a dozen lines of javascript, you can make beautiful dropdowns that work across all browsers. In case you’re wondering the javascript part is really only necessary for IE6. I’ve used this code for both Wordpress and Drupal themes with very few problems. Hint: don’t bother trying to get your menu items to text-align: center. It won’t work. Really, it won’t work.

Form validation with jQuery

by bassistance.de

Forms, how I loathe thee. Building forms is a total pain in the ass and filling out forms isn’t fun either. Still they can be a beautiful thing when they are done correctly. Luckily some very clever people have made it easier to build forms - such as pForm and with a bit of help from the folks at bassistance.de you can make filling out your forms easier for the average user with a bit of validation.

pngFix for IE with jQuery

by andreaseberhard.de

Png’s are wonderful for designers because they fully support transparency. From wikipedia, “PNG offers a variety of transparency options. With truecolor and greyscale images either a single pixel value can be declared as transparent or an alpha channel can be added.” Back in the old days you had to fudge drop-shadows, etc. by using a gif with a matte around it that was the same colour as the background.

I like pngFix because you don’t have to add special classes to your html in order for the fix to work. It also supports background-images BUT it doesn’t yet support repeating background images.

Leave a Reply