Blog Post RSS ?

Blogs » JavaScript & CSS » Making a dropdown with DOM scripting
 

Making a dropdown with DOM scripting

by Stuart Langridge

Aaron Gustafson is putting together a series of articles on how to make select elements stylable. In essence, what his work does is take the select out of the DOM and replace it with a ul, and then add script and CSS to make that ul work like a dropdown list. The advantage this gives is clear to everyone who’s ever complained about how selects aren’t stylable! The series has only just started, and there are a few concerns — the new element can’t be tabbed to, and doesn’t respond to keyboard events — but Aaron promises that part 2 will cover accessibility issues.

The script uses similar techniques to the Suckerfish dropdowns, applying “hover” and “selected” classes to various parts of the ul to provide hooks for styling (since IE doesn’t support :hover on things that aren’t links). This should be a useful technique to watch!

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Ping.fm
  • Twitthis

Related posts:

  1. The Right Way to Make a Dropdown Menu Whether you love them or hate them, it seems that...
  2. Progressive Enhancement and Graceful Degradation: Making a Choice How should you choose between progressive enhancement or graceful degradation...
  3. Making A Clipping Mask With Text In Photoshop Jennifer shows you how to make a clipping mask using...
  4. Brainstorming: Making Sense and Taking Action Alyssa wraps up her series on brainstorming with a step-by-step...
  5. Are You Making the Grade? How To Ask Clients for Feedback Client satisfaction surveys are an important part of freelancing and...

This post has 9 responses so far

Sponsored Links

SitePoint Marketplace

Buy and sell Websites, templates, domain names, hosting, graphics and more.

Follow SitePoint on...