OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

How can I make the page redirect if the zoom level is not 80%?

  • Thread starter Thread starter UnseeableCraft
  • Start date Start date
U

UnseeableCraft

Guest
I have two HTML files: index.html and zoomerror.html. The site only displays properly at a browser zoom level of 80%. Is there a way that I can use Javascript to detect the zoom level non-stop and redirect the page from index.html to zoomerror.html if the browser zoom level changes from 80% to some other level? I could not think of any code to do that.

I tried to use the window.devicePixelRatio function for this, but it just caused the page to constantly refresh, even though the zoom level was 80%.

<p>I have two HTML files: index.html and zoomerror.html.
The site only displays properly at a browser zoom level of 80%. Is there a way that I can use Javascript to detect the zoom level non-stop and redirect the page from index.html to zoomerror.html if the browser zoom level changes from 80% to some other level? I could not think of any code to do that.</p>
<p>I tried to use the <code>window.devicePixelRatio</code> function for this, but it just caused the page to constantly refresh, even though the zoom level was 80%.</p>
 

Latest posts

M
Replies
0
Views
1
MOHAMED AMIIN ABDI AADAN
M
Top