码迷,mamicode.com
首页 > 移动开发 > 详细

php工作笔记6-手机端适应缩放

时间:2015-12-08 18:05:08      阅读:162      评论:0      收藏:0      [点我收藏+]

标签:

1、静态页面

技术分享

2、缩放JS

function zoomin(orBkgWidth, orBkgHeight,bkg)
{


if(window.innerWidth  || document.documentElement.clientWidth){
    var widths = document.documentElement.clientWidth ? document.documentElement.clientWidth : window.innerWidth;
}



if (window.innerHeight || document.documentElement.clientHeight ) {
    var heights = document.documentElement.clientHeight ? document.documentElement.clientHeight : window.innerHeight;
}

b1 = widths / orBkgWidth;
b2 = heights / orBkgHeight;

r = Math.min(b1,b2);

$(bkg).css("-ms-transform","scale(" + r+ ")");

$(bkg).css("-moz-transform","scale(" +r+ ")");

$(bkg).css("-webkit-transform","scale(" + r+ ")");

$(bkg).css("-o-transform","scale(" +r+ ")");

$(bkg).css("-webkit-transform-origin","scale(" + r+ ")");

}

php工作笔记6-手机端适应缩放

标签:

原文地址:http://www.cnblogs.com/wl14253/p/5029564.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!