Zooming image with javascript

Click once to zoom larger, again to resize smaller again.

Place an image on your page with a smaller width and height than it really has.

<img border="0" src="zoomAimage.gif" width="100" height="100" onclick="zoomToggle('100px','100px','200px','200px',this);">

<!-- ONE STEP TO INSTALL INSTANT IMAGE ZOOMING:

 

1. Copy the coding into the BODY of your HTML document -->

 

<!-- STEP ONE: Paste this code into the BODY of your HTML document -->

 

<BODY>

 

<!-- This script and many more are available free online at -->

<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Original: CodeLifter () -->

<!-- Web Site: http://www.codelifter.com/ -->

<script>

var nW,nH,oH,oW;

function zoomToggle(iWideSmall,iHighSmall,iWideLarge,iHighLarge,whichImage){

oW=whichImage.style.width;oH=whichImage.style.height;

if((oW==iWideLarge)||(oH==iHighLarge)){

nW=iWideSmall;nH=iHighSmall;}else{

nW=iWideLarge;nH=iHighLarge;}

whichImage.style.width=nW;whichImage.style.height=nH;

}

</script>

<p><center>

<font face="arial, helvetica" size"-2">Free JavaScripts provided<br>

by <a href="http://javascriptsource.com">The JavaScript Source</a></font>

</center><p>

 

<!-- Script Size: 1.10 KB -->