Zoom in property

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Omg83191
    New Member
    • Aug 2012
    • 21

    Zoom in property

    Code:
    <script type="text/javascript">
    
     var minW = 1220;
    
            $(function () {
                CheckSizeZoom();
                $('#divWrap').css('visibility', 'visible');
            });
            $(window).resize(CheckSizeZoom);
    
            function CheckSizeZoom() {
                if ($(window).width() < minW) {
                    var zoomLev = $(window).width() / minW;
    
                    if (typeof (document.body.style.zoom) != "undefined") {
                        $(document.body).css('zoom', zoomLev);
                    }
                    else {
                        // Mozilla doesn't support zoom, use -moz-transform to scale and compensate for lost width
                        $('#divWrap').css({
                            "-moz-transform": 'scale(" + zoomLev + ")',
                            width: $(window).width() / zoomLev + 10,
                            position: 'relative',
                            left: (($(window).width() - minW - 16) / 2) + "px",
                            top: "-19px"
                        });
                    }
                }
                else {
                    $(document.body).css({
                        zoom: '',
                        position: '',
                        left: "",
                        top: "",
                        "-moz-transform": "",
                        width: ''
                    });
                }
            }
    </script>


    It doesn't work on IE, how can I fix this?
    Last edited by gits; Sep 20 '12, 09:49 AM. Reason: added code tags
  • gits
    Recognized Expert Moderator Expert
    • May 2007
    • 5390

    #2
    try to set the -ms-zoom property too

    Comment

    • Omg83191
      New Member
      • Aug 2012
      • 21

      #3
      it doesnt work properly...

      Comment

      • gits
        Recognized Expert Moderator Expert
        • May 2007
        • 5390

        #4
        what have you tried?

        Comment

        Working...