pc 端适配分辨率的方法

1.给body设置设计图的宽高;例如:设计图是1920*1080
$(‘body’).css({
‘width’: ‘1920px’,
‘height’: ‘1080px’,
‘transform’: ‘scale(’ + document.body.clientWidth / 1920 + ‘,’ + document.body.clientHeight / 1080 + ‘)’,
‘transform-origin’: ‘left top’,
})
2.通过 scale对设计图进行缩放

你可能感兴趣的:(pc 端适配分辨率的方法)