jquery修改浏览器整个页面百分比大小

function bodyScale() {
  var devicewidth = document.documentElement.clientWidth;
  var scale = devicewidth / 1560; // 分母——设计稿的尺寸
  //兼容firefox浏览器代码
  //需要transform-origin:center top设置,否则页面顶部看不到了
  $(".body").css({
     'transform': 'scale(' + scale + ')',
     '-moz-transform': 'scale(' + scale + ')',
    '-ms-transform': 'scale(' + scale + ')',
    'transform-origin': 'center top',
     '-ms-transform-origin': 'center top'
  });
  $("body").addClass('body') // transform下fixed会失效,但是通过class添加就不会
  $("body").css('zoom', scale);
}
$(function(){ bodyScale(); })
window.onresize = function () { bodyScale(); };
原文地址:https://www.cnblogs.com/ch-zaizai/p/14874448.html