/    Sign up×
Community /Pin to ProfileBookmark

How to zoom div content by using javascript?

How to zoom div content by using javascript?I am adding the my code below.But it is not supporting all browsers.
<html>
<head>
<script type=”text/javascript”>
function zoomings(){
var val=document.getElementById(“zooming”).value;

//alert(val);
searches.style.zoom=val;

searches.style.moz.zoom=val;
}

</script>
</head>
<body>

<span>Zoom</span><select id=’zooming’ onchange=”zoomings()”>
<option value=”25%”>25%</option>
<option value=”50%”>50%</option>
<option value=”75%”>75%</option>
<option value=”100%” selected=”selected”>100%</option>
<option value=”150%”>150%</option>
<option value=”200%”>200%</option>
<option value=”250%”>250%</option>
<option value=”300%”>300%</option>
</select>

</body>
</html>

to post a comment
HTML

3 Comments(s)

Copy linkTweet thisAlerts:
@perfectCoderMar 26.2013 — I don't think you're really going to get this script to work on all browsers. You should offer a lot more of you're code if you want precise help. Aside from writing a script for you, or directing you to another script that already does this, no one will be able to help you yet.

Please give more of your code. Where is "searches" class / id?

  • - Josh


  • Katy West Houston Air

    Katy Air
    Copy linkTweet thisAlerts:
    @deepthi_21456authorMar 26.2013 — <html>

    <head>

    <script type="text/javascript">

    function zoomings(){

    var val=document.getElementById("zooming").value;

    //alert(val);

    searches.style.zoom=val;

    searches.style.moz.zoom=val;

    }

    </script>

    </head>

    <body>

    <span>Zoom</span><select id='zooming' onchange="zoomings()">

    <option value="25%">25%</option>

    <option value="50%">50%</option>

    <option value="75%">75%</option>

    <option value="100%" selected="selected">100%</option>

    <option value="150%">150%</option>

    <option value="200%">200%</option>

    <option value="250%">250%</option>

    <option value="300%">300%</option>

    </select>

    <div id="searches">

    Some Content Here

    </div>

    </body>

    </html>
    Copy linkTweet thisAlerts:
    @rtretheweyMar 26.2013 — You could theoretically use some JavaScript to get cross-browser zooming if you use percentages and ems for all of the size properties of the contents of the "searches" <div>. Then all you have to do is modify the settings on the "searches" <div>. But as a practical matter, a lot depends on the content and the layout of the rest of the page.
    ×

    Success!

    Help @deepthi_21456 spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 9.27,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @ddiebold17,
    tipped: article
    amount: 1000 SATS,

    tipper: @Mqlinka19,
    tipped: live stream
    amount: 4900 SATS,

    tipper: @Mqlinka19,
    tipped: article
    amount: 10 SATS,
    )...