code: function(w, h) {
  			if (w && h) {
  				/* Reset apparent image size first so container grows */
  				this.$content.css('width', '').css('height', '');
  				/* Calculate the worst ratio so that dimensions fit */
  				 /* Note: -1 to avoid rounding errors */
  				var ratio = Math.max(
  					w  / (this.$content.parent().width()-1),
  					h / (this.$content.parent().height()-1));
  				/* Resize content */
  				if (ratio > 1) {
  					ratio = h / Math.floor(h / ratio); /* Round ratio down so height calc works */
  					this.$content.css('width', '' + w / ratio + 'px').css('height', '' + h / ratio + 'px');
  				}
  			}
  		}
docs: /* resizes the content so it fits in visible area and keeps the same aspect ratio.
  Does nothing if either the width or the height is not specified.
  Called automatically on window resize.
  Override if you want different behavior.