Can a web page adjust a browser's zoom level?

Internet explorer has a zoom control in the lower right corner.  Is there a way for a web page to make itself fit the view area by "auto-adjusting" this control in Internet Explorer?
Who is Participating?
remixedcatConnect With a Mentor Commented:
There are also scripts that will perform this action as well. There also are some that do not use the browser's zoom, however they scale the content and use CSS to re-render the elements.
jkofteConnect With a Mentor Commented:
actually, there is no way to detect it with javascript.
but there might be an alternative solution but this can take some time to do.

normally if you zoom in or zoom out in browser, if your content is defined by percentage the ratio of distance between the content remains the same. But if you have one content defined by percentage and one content defined by pixels, this ratio should change when you zoom in or out. by measuring the difference, you can calculate the zoom percentage of the browser.
RandyTommyConnect With a Mentor Author Commented:
I did not know bout the ZOOM function in javascript, which provides the real answer.
Remixedcat's comment led me to do the right Google search, which lead to the function below.

        function window_onresize()
            //  NOTE:  Resizes the document to fit the windows view area.
            //  Replace 1034 and 650 with your actual document dimentions.)

            var w = document.documentElement.clientWidth / 1034;
            var h = document.documentElement.clientHeight / 650;
            if (w < h)
       = w;
       = h;

<body onresize="return window_onresize()" >
RandyTommyAuthor Commented:
Also, It was good to know from jkofte that there is no way to detect zoom with Javascript.  (100 points)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.