examples/sprite/sprite.js
function() {
    var self = this;

    // Calculate the scale of our window from "full" size.
    var scale = window.innerWidth / 3600;

    // Resize and reposition the sprite overlays.
    var keys = Object.keys(self._spriteMap);
    for (var i=0; i<keys.length; i++) {
      var sprite = window[keys[i]];
      sprite.style.width = Math.round(self._width[i] * scale) + 'px';
      if (self._left[i]) {
        sprite.style.left = Math.round(self._left[i] * scale) + 'px';
      }
    }
  }
function() {
    var self = this;

    // Calculate the scale of our window from "full" size.
    var scale = window.innerWidth / 3600;

    // Resize and reposition the sprite overlays.
    var keys = Object.keys(self._spriteMap);
    for (var i=0; i<keys.length; i++) {
      var sprite = window[keys[i]];
      sprite.style.width = Math.round(self._width[i] * scale) + 'px';
      if (self._left[i]) {
        sprite.style.left = Math.round(self._left[i] * scale) + 'px';
      }
    }
  }
function ( ) { var self = this ; // Calculate the scale of our window from "full" size. var scale = window . innerWidth / 3600 ; // Resize and reposition the sprite overlays. var keys = Object . keys ( self . _spriteMap ) ; for ( var i = 0 ; i < keys . length ; i ++ ) { var sprite = window [ keys [ i ] ] ; sprite . style . width = Math . round ( self . _width [ i ] * scale ) + 'px' ; if ( self . _left [ i ] ) { sprite . style . left = Math . round ( self . _left [ i ] * scale ) + 'px' ; } } }
Called on window resize to correctly psotion and size the click overlays.
Called on window resize to correctly psotion and size the click overlays .