clipped from: ajaxian.com   

Wednesday, March 22nd, 2006

event:Selectors for Prototype

According to this post on the mir.aculou.us website, Justin Palmer has released event:Selectors, a "method to cleanly use CSS pseudo selectors to assign DOM events to elements on the page."

The functionality, bearing resemblance to the behaviour.js library, hooks into all of the latest Prototype functionality and adds a few tricks of its own. They provide a code example of how this new functionality can be used:

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

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

Posted by Chris Cornutt at 7:59 am

++++-
4.9 rating from 36 votes