/**
*
* 界面自适应屏幕宽度代码
*
*/
sizeAdaptation();
$(window).resize(function(){
sizeAdaptation();
});
/**
* 需要在html上增加 class = page-content-adapt-ui 特殊属性
*/
function sizeAdaptation(){
//特殊页面 不执行
var except =[
'/signin',
'/forget_pwd',
'/register',
'/showResetPwd'
];
if($.inArray(window.location.pathname,except) >= 0){
return false;
}
// var bodyWidth = document.body.clientWidth;
var bodyWidth = document.documentElement.clientWidth;
var clientHeight = document.documentElement.clientHeight;
// var clientHei = $('.page-content-adapt-ui').height();
if(bodyWidth<1200){
$('html').css({
'transform': 'scale('+bodyWidth/1366+')',
'transform-origin': 'top left&
界面自适应屏幕宽度代码
最新推荐文章于 2024-04-26 14:53:19 发布