10

I've done some research and found numerous posts including this one but they are all old and the answer on that page links to a library that says it no longer works in Firefox or Chrome.

Is there a current, reliable way to detect zooming and text-only zooming in browsers? How can it be handled?

Community
  • 1
  • 1
Don Rhummy
  • 24,730
  • 42
  • 175
  • 330
  • 1
    It may no longer be necessary depending on your use case. What are you trying to accomplish? Are you wanting to resize something via javascript when the user zooms text? – J E Carter II Jul 17 '14 at 13:33
  • @JECarterII preferably with CSS only, but I understand Javascript will likely be required. I am able to do it now by running an interval (`setInterval( checkSomeDivsWidth, 500 )`) but this means code needs to be running all the time. – Don Rhummy Jul 18 '14 at 05:57
  • Post up the section of javascript you're running in that interval. I suspect there may be a pure CSS option for you. – J E Carter II Jul 18 '14 at 12:44

1 Answers1

-3

script for zoom

<script type="text/javascript" src="../javascript/swfobject.js"></script>
<script type="text/javascript" src="../javascript/swfZoomDetection.js"></script>
<script type="text/javascript">
  swfZoomDetection.init({
 'onZoomChange': function(obj){ alert(obj.scale) },
 'getInitIfOne': true,
 'initCallOnly': false,
 'frameRate': 25
  });
</script>

text to be zoomed

  <body onLoad="loadFunction()">
  function loadFunction(){
     swfZoomDetection.init({ .... });
  }
 </body>
  • 1
    Please say where you got the code from and link to the actual files needed to be included. In this case: http://blog.sebastian-martens.de/2009/12/how-to-detect-the-browser-zoom-level-change-browser-zoo/ – mb21 Jul 18 '14 at 09:49