UPDATE: I've removed reg.pause() and reg.resume() from the trunk. Sean Hogan makes a good point in the comments below. Plus, now that reglib is doing delegation on form events, things get complicated maintaining the pause/resume system alongside the branch of code that simulates bubbling for form events in IE. One can still easily disable an event by using a selector like this: "body.on a@href" and then adding/remove 'on' from the body classname as necessary.


reglib has reached 1.0.6. Updates include:

reg.pause() and reg.resume() follow a similar pattern to reg.removeEvent():

// handle hover on all links
var hoverLinks = reg.hover('a@href',function(e){
    // handle mouseenter
},function(e){
    // handle mouseleave
});

// stop handling hover on links
reg.pause(hoverLinks);

// resume handling hover on links
reg.resume(hoverLinks);

More info: all reglib posts, reglib feed, download reglib

Comments:

Wouldn't it be better to rely on modifying the class attribute? That would seem to be consistent with the concept of behavior stylesheets.

Posted by Sean Hogan on December 02, 2008 at 02:49 AM MST #

@Sean - I actually agree for the most part, but in the past on rare occasions I've missed having this ability.

Posted by greg on December 02, 2008 at 12:48 PM MST #

Post a Comment:
Comments are closed for this entry.

This blog copyright 2009 by greimer