当前位置:网站首页>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
边栏推荐
猜你喜欢
Some experience of using dialogfragment and anti stepping pit experience (getactivity and getdialog are empty, cancelable is invalid, etc.)
字节面试编程题:最小的K个数
HyperBDR云容灾V3.3.0版本发布|容灾功能升级,资源组管理功能优化
01-nio basic ByteBuffer and filechannel
OpenStack如何跨版本升级
Operation instructions of star boundary text automatic translator
星界边境文本自动翻译机使用说明
sar命令详解
Use the executors class to quickly create a thread pool
Pass in external parameters to the main function in clion
随机推荐
MySQL lock database lock
ActiveMQ Basics
金融行业云迁移实践 平安金融云整合HyperMotion云迁移解决方案,为金融行业客户提供迁移服务
关于云容灾,你需要知道这些
教育行业云迁移最佳实践:海云捷迅使用HyperMotion云迁移产品为北京某大学实施渐进式迁移,成功率100%
Research on recyclerview details - Discussion and repair of recyclerview click dislocation
A table splitting implementation scheme of MySQL and InnoDB, MyISAM and MRG_ Introduction to MyISAM and other engine application scenarios
时间复杂度计算举例
About the configuration and use of json5 in nodejs
RecyclerView高级使用(一)-侧滑删除的简单实现
Visio画拓扑图随记
On the problem of cliff growth of loss function in the process of training
如何轻松做好一个项目
星界边境文本自动翻译机使用说明
星界边境Starbound创意工坊订阅的mod的存放路径
mysql 5.1升级到5.611
文字组合,不重复,做搜索或查询关键字匹配
MySQL-InnoDB-事务
DP - [noip2000] grid access
Introduction to loan market quotation interest rate (LPR) and loan benchmark interest rate