当前位置:网站首页>Web page, adaptive, proportional scaling
Web page, adaptive, proportional scaling
2022-04-23 14:16:00 【Ruirui junior】
You can write a predetermined width and height first , Then scale it proportionally ,
// Adaptive scaling
getc() {
// let width = document.documentElement.clientWidth;
// let height = document.documentElement.clientHeight;
window.addEventListener('load', adaptation);
window.addEventListener('resize', adaptation);
function adaptation() {
var w = document.body.clientWidth;
var h = document.body.clientHeight;
var nw = 2048;
var nh = 1536;
var left, top, scale, scale1;
scale = w / nw
scale1 = h / nh
if (scale1 < scale) {
document.getElementById('main').setAttribute('style', 'transf
版权声明
本文为[Ruirui junior]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231408339342.html
边栏推荐
猜你喜欢
Research on recyclerview details - Discussion and repair of recyclerview click dislocation
容灾有疑问?点这里
关于NodeJS中JSON5的相关配置和使用
某政务云项目业务系统迁移调研实践
OpenStack如何跨版本升级
Some experience of using dialogfragment and anti stepping pit experience (getactivity and getdialog are empty, cancelable is invalid, etc.)
统信UOS PHP7.2.3升级至PHP7.2.24
On the multi-level certificate based on OpenSSL, the issuance and management of multi-level Ca, and two-way authentication
KVM学习资源
MySQL-InnoDB-事务
随机推荐
Essential difference between restful WebService and gSOAP webservice
How does void * exist?
Quickly understand the three ways of thread implementation
Logback logger and root
PySide2
获取线程返回值Future接口与FutureTask类使用介绍
Introduction to the use of semaphore for inter thread control
mysql 5.1升级到5.68
On September 8, the night before going to Songshan Lake
ActiveMQ Basics
VMware15Pro在Deepin系统里面挂载真机电脑硬盘
统信UOS PHP7.2.3升级至PHP7.2.24
如何轻松做好一个项目
Win10 comes with groove music, which can't play cue and ape files. It's a curvilinear way to save the country. It creates its own aimpack plug-in package, and aimp installs DSP plug-in
RecyclerView细节研究-RecyclerView点击错位问题的探讨与修复
Visio installation error 1:1935 2: {XXXXXXXX
使用DialogFragment的一些感受及防踩坑经验(getActivity、getDialog为空,cancelable无效等)
js 键值判断
mysql 5.1升级到5.66
Get the thread return value. Introduction to the use of future interface and futuretask class