Support for max width/height and browser resize event