CSS event:Selectors

Justin Palmer has created a wonderful JavaScript snippet named CSS event:Selectors that allows you to allow you access to Javascript events using a CSS style syntax. Here is a quick example:



 var Rules = {
   '#icons a:mouseover': function(element) {
     element.style.display = "none";
   },

   '#icons a:mouseout': function(element) {
     element.style.display = "block";
   }
 }

Pretty sweet!

One Response to “CSS event:Selectors”

  1. Rasmus said on July 29th, 2006 at 9:53 am

    Reminds me of Behaviour: http://bennolan.com/behaviour/