resize.js 627 B

12345678910111213141516171819202122232425262728
  1. window.onresize = function() {
  2. setAppScale();
  3. };
  4. function setAppScale() {
  5. var ratioY = $(window).height()/1536;
  6. var ratioX = $(window).width()/4352;
  7. var screenWidth = window.screen.width;
  8. var screenHeigth = window.screen.height;
  9. if (screenWidth >= 960) {
  10. ratioX = 0.62
  11. }
  12. if(screenHeigth <= 1080){
  13. ratioY = 0.62
  14. }
  15. $("body").css({
  16. transform: "scale("+ ratioX+","+ ratioY+")",
  17. transformOrigin: "left top",
  18. overflow:"visible"
  19. });
  20. }
  21. $().ready(function(){
  22. //初始化时调整大小
  23. setAppScale();
  24. });