Click here to Skip to main content
15,905,427 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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">
C#
function zoomings(){
var val=document.getElementById("zooming").value;

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

                searches.style.moz.zoom=val;
            }


</script>
</head>
<body>
XML
<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>
Posted

if searches is your div id then try following code
C#
function zoomings(optionSel)
{
 var OptionSelected = optionSel.selectedIndex;
var val = optionSel.options[OptionSelected].text;
//alert(val);
var div = document.getElementById ("searches");
div.style.zoom = val;
}

XML
<span>Zoom</span><select id='zooming' onchange="zoomings (this);">
        <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>
 
Share this answer
 
v4
Comments
Deepthi.21456 25-Mar-13 3:01am    
It is not working?
Pallavi Waikar 25-Mar-13 3:19am    
check updated answer
Deepthi.21456 25-Mar-13 3:35am    
It is working in chrome.Remaining browsers it is not working?
Pallavi Waikar 25-Mar-13 3:40am    
then try this link for jquery http://stackoverflow.com/questions/13931225/how-to-zoom-div-content-using-jquery
Deepthi.21456 25-Mar-13 3:34am    
that is also not working?
Hi Deepthi,


Please refer links given below:


zoom-text

add-magnifying-zoom-tool-zoomer

scrolling-and-zooming-in-a-div

ow-to-zoom-div-content-using-jquery



Don't forget to mark useful responses as Answer if they helped you towards a solution. :)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900