force firefox or ie to zoom out on page load

Posted on 2009-12-20
Last Modified: 2013-12-13
I generally create web pages that don't scale well to browsers unless you zoom out a little (i.e. ) Rather than redesign the page to a smaller scale, and being lazy, I'm hoping somebody hascode or a link to code (asp/php/java) that would force the visitors browser to zoom out. The code could be any language. TIA
Question by:GlennHarris
    LVL 70

    Assisted Solution

    by:Jason C. Levine
    I don't think you're going to be able to do that.  The user's zoom settings are under  their control and no scripting language interacts with it (to the best of my knowledge).

    What you can do is detect the viewport and scale sizes based on that, but it's an inexact science at best.
    LVL 12

    Author Comment

    OK, thanks for the advice, then maybe you can point me where to look for this code: I'll put a zoom icon for zoom in/out and want that to zoom the screen for them (since most users don't know ctrl+scroll). Thx
    LVL 2

    Accepted Solution

    You would need a signed script to access prefs:
    E.g code like this could do it (this code only works if run on a local page, you get a security pop-up):

    javascript:(function getZoomFull(){var FZ='browser.zoom.full';try{'UniversalPreferencesRead');var fz=navigator.preference(FZ);fz=prompt('Full Zoom: ',fz);}catch (e){alert('Permission to access browser.zoom.full was denied');}})();

    But i Really Really Really recommend the use of Javascript to change CSS settings when user clicks on your [+] / [-] buttons, you will be able to control the layout and the amount of zoom to be done in the diferent html elements.

    LVL 2

    Expert Comment

    hello, how is this going? did you find a solution? can we help with something else?
    LVL 12

    Author Closing Comment


    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Suggested Solutions

    Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
    Adobe Dreamweaver CS5 is a WYSIWYG web page editor that has advanced HTML, CSS, and Javascript rendering functionality and is probably the most well-known HTML editor available. Much of Dreamweaver's appeal centers around the Design View interfac…
    The viewer will learn how to count occurrences of each item in an array.
    The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now