当前位置:网站首页>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
边栏推荐
- 关于云容灾,你需要知道这些
- 获取线程返回值Future接口与FutureTask类使用介绍
- Research on recyclerview details - Discussion and repair of recyclerview click dislocation
- std::map 和 std::vector 内存释放
- pthread_ Why does self() repeat
- MySQL数据库讲解(七)
- SSH 通过跳板机连接远程主机
- HyperBDR云容灾V3.2.1版本发布|支持更多云平台,新增监控告警功能
- 金融行业云迁移实践 平安金融云整合HyperMotion云迁移解决方案,为金融行业客户提供迁移服务
- VMware 15pro mounts the hard disk of the real computer in the deepin system
猜你喜欢

使用DialogFragment的一些感受及防踩坑经验(getActivity、getDialog为空,cancelable无效等)

KVM学习资源

利用json-server在本地创建服务器请求

剑指offer刷题(1)--面向华为

处理 mkdir:无法创建目录“aaa“:只读文件系统

金融行业云迁移实践 平安金融云整合HyperMotion云迁移解决方案,为金融行业客户提供迁移服务

星界边境文本自动翻译机使用说明

About the configuration and use of json5 in nodejs

RecyclerView细节研究-RecyclerView点击错位问题的探讨与修复

困扰多年的系统调研问题有自动化采集工具了,还是开源免费的
随机推荐
redis数据库讲解二(redis高可用、持久化、性能管理)
正则表达式
返回数组排序后下标
01-NIO基础之ByteBuffer和FileChannel
Gartner预测云迁移规模大幅增长;云迁移的优势是什么?
修改Firebase Emulators的默认侦听IP
使用开源调研工具Prophet是一种什么体验?
RecyclerView高级使用(二)-垂直拖拽排序的简单实现
剑指offer刷题(2)--面向华为
Redis数据库讲解(一)
JDBC details
mysql 5.1升级到5.610
線程組ThreadGroup使用介紹+自定義線程工廠類實現ThreadFactory接口
js 键值判断
Pass in external parameters to the main function in clion
贷款市场报价利率(LPR)与贷款基准利率介绍
MySQL数据库讲解(九)
拨开云雾synchronized使用五种方式介绍
mysql锁数据库锁
Some experience of using dialogfragment and anti stepping pit experience (getactivity and getdialog are empty, cancelable is invalid, etc.)