By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,689 Members | 1,915 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,689 IT Pros & Developers. It's quick & easy.

Zoom in property

P: 21
Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">
  2.  
  3.  var minW = 1220;
  4.  
  5.         $(function () {
  6.             CheckSizeZoom();
  7.             $('#divWrap').css('visibility', 'visible');
  8.         });
  9.         $(window).resize(CheckSizeZoom);
  10.  
  11.         function CheckSizeZoom() {
  12.             if ($(window).width() < minW) {
  13.                 var zoomLev = $(window).width() / minW;
  14.  
  15.                 if (typeof (document.body.style.zoom) != "undefined") {
  16.                     $(document.body).css('zoom', zoomLev);
  17.                 }
  18.                 else {
  19.                     // Mozilla doesn't support zoom, use -moz-transform to scale and compensate for lost width
  20.                     $('#divWrap').css({
  21.                         "-moz-transform": 'scale(" + zoomLev + ")',
  22.                         width: $(window).width() / zoomLev + 10,
  23.                         position: 'relative',
  24.                         left: (($(window).width() - minW - 16) / 2) + "px",
  25.                         top: "-19px"
  26.                     });
  27.                 }
  28.             }
  29.             else {
  30.                 $(document.body).css({
  31.                     zoom: '',
  32.                     position: '',
  33.                     left: "",
  34.                     top: "",
  35.                     "-moz-transform": "",
  36.                     width: ''
  37.                 });
  38.             }
  39.         }
  40. </script>


It doesn't work on IE, how can I fix this?
Sep 20 '12 #1
Share this Question
Share on Google+
3 Replies


gits
Expert Mod 5K+
P: 5,390
try to set the -ms-zoom property too
Sep 20 '12 #2

P: 21
it doesnt work properly...
Sep 20 '12 #3

gits
Expert Mod 5K+
P: 5,390
what have you tried?
Sep 20 '12 #4

Post your reply

Sign in to post your reply or Sign up for a free account.