Archive for the ‘Event Scripting’ Category

event:Selectors for Prototype

March 23rd, 2006 by Aaron N.

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}); } }

Linkdump

March 16th, 2006 by markbult

Sorry about the non-annotated linkdump. Aaron’s always after me to post stuff here instead of emailing him links to new things I find, but I just don’t have time to describe all these sites. At least I categorized them… Read the rest of this entry »

window.onload and its issues

February 21st, 2006 by Aaron N.

Bill Graham was asking me about where to put javascript events today. window.onload? At the bottom of the html document? Attached to the onload event of an image somewhere in the page?

Here’s an article by Dean Edwards on an interesting solution that works for IE and Firefox.

For the life of me, I can’t find the article that I read a week or so ago on this topic that outlined numerous strategies on dealing with window.onload issues, but one option to consider is using event monitoring in prototype to monitor the browser for an element to be present before performing an action on it.

Using Events in Prototype

February 8th, 2006 by Aaron N.

-via Ajaxian (I know, I get a lot of ideas from this site!)

Ecytemedia has an article on how to use Events in Prototype. It dives into attaching functions to events using Event.observe along with some advanced javascript using anonymous functions and closures. Read the rest of this entry »