Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Apple's UK site billboard resizing JavaScript

By: a guest on Nov 3rd, 2012  |  syntax: JavaScript  |  size: 0.62 KB  |  views: 3,980  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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. });