How to use js to control the display of the PC page to the mobile side is the overall zoom? Http://www.majesticcreekcc.com/ is similar to this website.

now I want to make a PC page with exactly the same layout as the mobile page, but I don"t know how to control the page zooming. http://www.majesticcreekcc.co.

Mar.23,2021

this requirement does not need to write adaptation, directly access the pc version, the mobile browser can zoom the full screen.
if you have to zoom, use js to monitor the width-to-height ratio of the screen, and then use the scale property of css3 to zoom accordingly.

calculate page magnification: magnification = logical resolution / physical resolution of the screen
logical resolution is obtained by window.screen.width,
physical resolution is obtained by window.screen.width * window.devicePixelRatio,

scale (magnification);


  <meta name="viewport" content="width=device-width, initial-scale=0,user-scalable=no,maximum-scale=1.0">

add this to each html header, mine is fine


there is no need to zoom, only the resolution of the mobile device meets the requirements.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3f647-40a18.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3f647-40a18.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?