Sunday, November 22, 2009

Project work in one part Zooming Image

20.Zooming Image: 
      When we click on the mytest button, image zooming Upto 500 width and height. we can change image Zooming size here if(value < =500).just copy the code and past to your HTML page

< html >
< body  >
< div id="main" >
< img id="image1" src="9.jpg" width="10" height="10" / >
< /div >
< input type="button" value="mytest" onClick="test()" / >
< /center >
< /body >
< /html >
< script type="text/javascript" >
var value=110;
function test()
{
if(value < =500)
{
var a=document.getElementById("main");
var b=a.getElementsByTagName("img");
b[0].width=value;
b[0].height=value;
value=value+2;
setTimeout(test,1);
}
}
< /script >

No comments:

Post a Comment