document.observe('click', function(e, el) {
if (e.target != Element.descendantOf('calendar')) {
$('calendar').fade();
}
});
I am trying to do something when a click is registered outside a certain container. In my code above, it's the $('calendar').
The above doesn't work.
document.observe('click', function(e, el) {
if ( ! e.target.descendantOf('calendar')) {
Effect.toggle('calendar', 'appear', {duration: 0.4});
}
});
I think this is working now. If anyone has something better. I'll be happy to hear them