// detect resize
(function() {
  var oldresize = window.onresize;
  window.onresize = function(e) {
    var event = window.event || e;
    if(typeof(oldresize) === 'function' && !oldresize.call(window, event)) {
      return false;
    }
    if(typeof(window.onzoom) === 'function') {
      return window.onzoom.call(window, event);
    }
  }
})();
function detectZoom() {
  var ratio = 0,
      screen = window.screen,
      ua = navigator.userAgent.toLowerCase();

  if (window.devicePixelRatio !== undefined) {
    ratio = window.devicePixelRatio;
  }
  else if (~ua.indexOf('msie')) {
    if (screen.deviceXDPI && screen.logicalXDPI) {
      ratio = screen.deviceXDPI / screen.logicalXDPI;
    }
  }
  else if (window.outerWidth !== undefined && window.innerWidth !== undefined) {
    ratio = window.outerWidth / window.innerWidth;
  }

  if (ratio) {
    ratio = Math.round(ratio * 100);
  }
  return ratio;
}
setTimeout(function () {
  if (detectZoom() >= 125) {
    $('.piaochuang').css('left', '0px');
  } else {
    $('.piaochuan').css('left', '8%');
  }
}, 1000)

window.onzoom = function(e) {
  // zoom even
  if (detectZoom() >= 125) {
    $('.piaochuang').css('left', '0px');
  } else {
    $('.piaochuan').css('left', '8%');
  }
};
