Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detect browser zoom level

I have a div with border-right property. When my site is zoomed out the div size will adapt but the border will still stay the same size. This results in the div moving outside its parent. Is there a way to detect the zoom level? So that I could change size depending on the zoom. And if so, then how?

Thanks in advance

like image 789
Hwende Avatar asked Oct 21 '22 19:10

Hwende


1 Answers

var zoom = window.outerWidth / window.document.documentElement.clientWidth
like image 143
Saraf Talukder Avatar answered Oct 23 '22 15:10

Saraf Talukder