Thomas Fuchs
Hi, I'm Thomas Fuchs. I'm the author of Zepto.js, of, and I'm a Ruby on Rails core alumnus. With Amy Hoy I'm building cheerful software, like Freckle Time Tracking and Every Time Zone and write books like
   Want me to speak at your conference? Contact me!

event:Selectors for Prototype

March 21st, 2006

Justin Palmer has released event:Selectors, a method to cleanly use CSS pseudo selectors to assign DOM events to elements on the page.

It’s inspired by behaviour.js, but builds on all the latest Prototype goodness and adds some nice new features.

Here’s a snippet of what you can do (notice how nicely it works together with!):

var Rules = {
  '#icons a:mouseover': function(element) {
     var app =;
     new Effect.BlindDown(app + '-content',
       {queue: 'end', duration: 0.2});

   '#icons a:mouseout': function(element) {
     var app =;
     new Effect.BlindUp(app + '-content',
       {queue: 'end', duration: 0.2});

Examples for multiple assignments and event passing:

'#feature, #otherstuff': function(element) {

'.links a:click': function(element, event) {

Update: Here’s the official announcement from Justin – and shame on me for leaking :)