Can more than one JavaScript handler register to an event such as window.onresize
?
I tried using +=
, but that had no effect. Only =
and that obviously replaces any previously assigned events.
For IE you can use:
window.attachEvent('onresize', handler);
where handler is your handler function.
In all other browsers you can use:
window.addEventListener('resize', handler);
Both of these functions can be used multiple times to attach multiple event handlers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With