Comments on: detect Page Zoom for IE7 http://blog.hedgerwow.com/2007/12/05/detect-page-zoom-for-ie7/ Keep It Simple, Stupid Mon, 10 Aug 2009 03:57:54 +0000 http://wordpress.org/?v=2.0.5 by: Dan Strother http://blog.hedgerwow.com/2007/12/05/detect-page-zoom-for-ie7/#comment-274 Tue, 20 Jan 2009 16:50:40 +0000 http://blog.hedgerwow.com/2007/12/05/detect-page-zoom-for-ie7/#comment-274 I've found a seemingly very reliable way of accurately determining the zoom level in IE7: var rect = document.body.getBoundingClientRect(); var zoomLevel = Math.round( (rect.right-rect.left)/document.body.clientWidth * 100); This is accurate to well within 1% on the majority of sites I tested, and works over the whole range of 10%-1000%. I’ve found a seemingly very reliable way of accurately determining the zoom level in IE7:

var rect = document.body.getBoundingClientRect();
var zoomLevel = Math.round( (rect.right-rect.left)/document.body.clientWidth * 100);

This is accurate to well within 1% on the majority of sites I tested, and works over the whole range of 10%-1000%.

]]>
by: Tuemmel http://blog.hedgerwow.com/2007/12/05/detect-page-zoom-for-ie7/#comment-233 Sat, 19 Jul 2008 15:01:02 +0000 http://blog.hedgerwow.com/2007/12/05/detect-page-zoom-for-ie7/#comment-233 The page zoom does not happen in appended Child Nodes by the dom. This is really a disaster. The page zoom does not happen in appended Child Nodes by the dom. This is really a disaster.

]]>
by: 133th http://blog.hedgerwow.com/2007/12/05/detect-page-zoom-for-ie7/#comment-219 Sun, 25 May 2008 18:12:38 +0000 http://blog.hedgerwow.com/2007/12/05/detect-page-zoom-for-ie7/#comment-219 hmm, may you or your co-worker know how to disable page zoom?)) hmm, may you or your co-worker know how to disable page zoom?))

]]>
by: SharkD http://blog.hedgerwow.com/2007/12/05/detect-page-zoom-for-ie7/#comment-200 Mon, 28 Apr 2008 21:41:05 +0000 http://blog.hedgerwow.com/2007/12/05/detect-page-zoom-for-ie7/#comment-200 Some more notes: Notice that when zooming from 140% to 180%, the onresize event fires only when it's 150% and 180%. When zooming from 180% to 140% it only fires when it's 170% and 140%. Between 120% and 130% the event never fails to fire. Some more notes:

Notice that when zooming from 140% to 180%, the onresize
event fires only when it’s 150% and 180%. When zooming from
180% to 140% it only fires when it’s 170% and 140%.
Between 120% and 130% the event never fails to fire.

]]>
by: SharkD http://blog.hedgerwow.com/2007/12/05/detect-page-zoom-for-ie7/#comment-195 Thu, 17 Apr 2008 19:00:56 +0000 http://blog.hedgerwow.com/2007/12/05/detect-page-zoom-for-ie7/#comment-195 I noticed also that in quirksmode, IE7 definitely fires the onresize event each time the page is zoomed. Turn quirksmode off, and it skips the occasional event. I noticed also that in quirksmode, IE7 definitely fires the onresize event each time the page is zoomed. Turn quirksmode off, and it skips the occasional event.

]]>
by: SharkD http://blog.hedgerwow.com/2007/12/05/detect-page-zoom-for-ie7/#comment-194 Thu, 17 Apr 2008 17:18:53 +0000 http://blog.hedgerwow.com/2007/12/05/detect-page-zoom-for-ie7/#comment-194 Some comments: Change n%10 to n%5 and n = n - r + 10 to n = n - r + Math.round(r/5)*5. This catches percentages like 75%, and your code wasn't catching 110% properly. Also, there's no point setting a timeout if the function only gets fired on a window resize (in IE this doesn't happen every time!!!!). Use an interval instead (or use both). I know an interval is not graceful, but... Also, if you use an interval you can put it within the init function for when the document gets loaded. Some comments:

Change n%10 to n%5 and n = n - r + 10 to n = n - r + Math.round(r/5)*5.
This catches percentages like 75%, and your code wasn’t catching 110% properly.

Also, there’s no point setting a timeout if the function only gets fired on a window resize (in IE this doesn’t happen every time!!!!). Use an interval instead (or use both). I know an interval is not graceful, but… Also, if you use an interval you can put it within the init function for when the document gets loaded.

]]>
by: Shi Chuan http://blog.hedgerwow.com/2007/12/05/detect-page-zoom-for-ie7/#comment-173 Thu, 10 Jan 2008 17:37:42 +0000 http://blog.hedgerwow.com/2007/12/05/detect-page-zoom-for-ie7/#comment-173 Hi, Hedger. I was always wondering what IE6 programm you use to test IE6? I have a software called Multiple IE which can allow both IE6, IE7 installed. But I found IE6 under Multiple IE doesnt render HTML pages the way stand alone IE6 does. May I know what you guys at Yahoo! or you presonally use to do Multiple IE testing? Thanks in advance! Hi, Hedger.

I was always wondering what IE6 programm you use to test IE6? I have a software called Multiple IE which can allow both IE6, IE7 installed. But I found IE6 under Multiple IE doesnt render HTML pages the way stand alone IE6 does. May I know what you guys at Yahoo! or you presonally use to do Multiple IE testing?

Thanks in advance!

]]>