Programatically using zoom vs Setting zoom level

Discussion in 'Internet Explorer' started by Jon Brown, Mar 11, 2010.

  1. Jon Brown

    Jon Brown Guest

    Using IE 7 & 8, I need to supply buttons on a page to allow the user to zoom
    in or out (I know they could simply user the browser to do this but.........
    it’s a long story!!) Experimenting with ways to achieve this, I am having
    difficulty achieving the same level of functionality when programmatically
    applying a zoom as appears available using the browser menu.
    On the very basic webpage below, if I use ctrl (+/-) to zoom the page, the
    page content is resized correctly and everything if fine; However, if I apply
    a zoom level by setting the .style.zoom property programmatically when
    pressing the "Go" button, the zoom occurs but the contained paragraph is not
    resized meaning that the text is now off the page and, despite setting the
    overflow property to "auto" no scrollbar is present.
    Am I omitting a step somewhere? Any help would be much appreciated!!

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    <html xmlns="">
    <!-- DW6 -->
    <!-- Copyright 2005 Macromedia, Inc. All rights reserved. -->
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Untitled Document</title>

    function zoomIE()
    var content = document.getElementById("content"); = "1.2"; = "auto"; = "auto";

    <div id="content">
    <h2 id="pageName">Zoom</h2>
    <input name="goButton" type="button" value="go" onclick="zoomIE();" />
    <h3>Feature Title </h3>
    <p> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec
    molestie. Sed aliquam sem ut arcu. Phasellus sollicitudin. Vestibulum
    condimentum facilisis nulla. In hac habitasse platea dictumst. Nulla nonummy.
    Cras quis libero. Cras venenatis. Aliquam posuere lobortis pede. Nullam
    fringilla urna id leo. Praesent aliquet pretium erat. Praesent non odio.
    Pellentesque a magna a mauris vulputate lacinia. Aenean viverra. Class aptent
    taciti sociosqu ad litora torquent per conubia nostra, per inceptos
    hymenaeos. Aliquam lacus. Mauris magna eros, semper a, tempor et, rutrum et,
    tortor. </p>

    <br />
    Jon Brown, Mar 11, 2010
    1. Advertisements

  2. Developer-specific resources include:

    MSDN IE Development Forum (post such questions here instead)

    Tip: When posting in Developer forums, always include a link to your web
    site or test pages in your first post.

    IE Developer Center

    Learn IE8

    HTML and DHTML Overviews and Tutorials and

    Cascading Style Sheets (CSS)

    Expression Web SuperPreview for Internet Explorer (free, stand-alone visual
    debugging tool for IE6, IE7, and IE8)

    Expression Web SuperPreview Release Notes


    PA Bear [MS MVP], Mar 11, 2010
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.