views:

35

answers:

1

I saw this code on someone else's website, but found no reference to it on jQuery's site.

window.addEvents({
  'domready': resizer,
  'resize': resizer
}); 

Can either: someone point me to the documentation for addEvents or explain to me how it works?

+4  A: 

That's not jQuery. It's MooTools.

The equivalent in jQuery would be:

$(window).bind({
    load: resizer,
    resize: resizer
});

bind accepts a map of event names to handler functions.

Anurag
I should stop assuming things...
Ashley Ward
+1 but you kinda hurt the OP's fellings.. ;)
Reigel
@Ashley - The jQuery version turned out to be rather close, so it's all good :). @Reigel - I feel really guilty now and will delete my answer as soon as it gets a mere 10000000000000 votes :P
Anurag