SHARE
TWEET

Apple's UK site billboard resizing JavaScript

a guest Nov 3rd, 2012 4,141 Never
  1. var HeroResize=AC.Class({initialize:function(b){this._height=null;this._hero=$(b);
  2. AC.Object.synthesize(this);this.__boundResizeHero=this.resizeHero.bindAsEventListener(this);
  3. if(typeof window.ontouchstart==="undefined"){this.resizeHero();Event.observe(window,"resize",this.__boundResizeHero)
  4. }},setHeight:function(b){this._height=(b<0)?0:b;return this._height},resizeHero:function(){this.setHeight(parseInt(window.innerHeight||(window.document.documentElement.clientHeight||window.document.body.clientHeight),10)-310);
  5. this.hero().style.height=this.height()+"px"}});Event.onDOMReady(function(){var b=new HeroResize("billboard")
  6. });
RAW Paste Data
Top