How to detect page zoom level in all modern browsers?

后端 未结 28 1882
慢半拍i
慢半拍i 2020-11-21 05:27
  1. How can I detect the page zoom level in all modern browsers? While this thread tells how to do it in IE7 and IE8, I can\'t find a good cross-browser solution.

28条回答
  •  旧时难觅i
    2020-11-21 06:13

    This is question was posted like ages back, but today when i was looking for the same answer "How to detect zoom in and out event", i couldn't find one answer that would fit all the browsers.

    As on now : For Firefox/Chrome/IE8 and IE9 , the zoom in and out fires a window.resize event. This can be captured using:

    $(window).resize(function() {
    //YOUR CODE.
    });
    

提交回复
热议问题