Page or Form Zoom-In and Zoom-Out using Javascript

vishalneeraj-24503
Posted by vishalneeraj-24503 under JavaScript category on | Points: 40 | Views : 441
Below is the code:-
<body runat = "server" id = "bdy" style = "zoom:100%">
</body>

function Page_Zoom_In()
{
var Page = document.getElementById('Body');
var zoom = parseInt(Page.style.zoom) + 20 +'%';
Page.style.zoom = zoom;
return false;
}

function Page_Zoom_Out()
{
var Page = document.getElementById('Body');
var zoom = parseInt(Page.style.zoom) - 20 +'%';
Page.style.zoom = zoom;
return false;
}

<input id="btn_zoom_in" type="button" value="Zoom In" onclick="Page_Zoom_In();" />
<input id="btn_zoom_out" type="button" value="Zoom Out" onclick="Page_Zoom_Out();"/>

Comments or Responses

Login to post response