Search code examples
javascriptdomprototypejsobserver-pattern

PrototypeJS observe windows dimensions change?


I'm trying to create my own 'modal' window since none of these currently existing for PrototypeJS fits my needs.

The problem is observing document.documentElement for change of height and width of viewport ( or document.body, depending on Quirks/Standard mode ).


Solution

  • Can't you just observe the window.onresize event?

    Event.observe(window, 'resize', function() { alert('resized'); });