The window isn't an element in the DOM.

If you want to collect all clicks on the page, I recommend listening on the
document instead.
On Sep 29, 2011 8:51 AM, "campari" <[email protected]> wrote:
> Hi everyone,
>
> i'm using the latest mootools and trying to add onclick-event on
> window:
>
> window.addEvent('click', function() {
> if(menu.bPersonal===true)
> menu.closePersonal();
> });
>
> All tested browser behave as expected except IE8.
> For IE8 it is possible to add onclick on body element merely:
>
> $$('body')[0].addEvent('click', function() {
> if(menu.bPersonal===true)
> menu.closePersonal();
> });
>
>
> How to add onlick-event on window?
>
> Thanks in advance!

Reply via email to