图片放大缩小

<input type="button" value="缩小" onclick="small1()">
              <input type="button" value="放大" onclick="big1()">
              <br>
              <BR>
              <img border="0"  name=images1 src="image/031.jpg" width="140" height="105">
              <script>
function small(){
var height1=images0.height
var width1=images0.width
images0.height=height1/1.5
images0.width=width1/1.5}

function big(){
var height1=images0.height
var width1=images0.width
images0.height=height1*1.5
images0.width=width1*1.5}

function small1(){
var height1=images1.height
var width1=images1.width
images1.height=height1/1.5
images1.width=width1/1.5}

function big1(){
var height1=images1.height
var width1=images1.width
images1.height=height1*1.5
images1.width=width1*1.5}
</script>

<script language="JavaScript">
<!--
function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
//-->
</script>
//修改SCR后的图像地址,注意要和下面的地址相同
<a href="" onClick="return false"><img name="small" border="0" src="photo/display.jpg" width="100" height="135" onClick="MM_showHideLayers('layer2','','show');MM_showHideLayers('layer','','hide');MM_showHideLayers('layer1','','hide');"></a>
<div id="layer2" style="position: absolute; left: 14px; top: 3px; 765; height: 202; z-index: 1; visibility: hidden">
  <table border="0" width="761" height="216" cellspacing="0" cellpadding="0">
    <tr bordercolor="#FFFFFF">
      <td width="624" valign="top" align="left">  
        <div align="center">
          <center>
            <table border="0" width="122%" height="181" cellspacing="0" cellpadding="0">
              <tr>
  //修改SCR后的图像地址,注意要和上面的地址相同            
 <td width="100%" height="151" valign="top" align="center"><a href="" onclick="return false" ><img name="big" src="photo/display.jpg" onclick="MM_showHideLayers('layer2','','hide');MM_showHideLayers('layer','','show');MM_showHideLayers('layer1','','show');return false;" border="0"></a>
                </td>
              </tr>
              <tr>
                <td width="100%" height="12" valign="top" align="center"> </td>
              </tr>
            </table>
          </center>
        </div>
      </td>
    </tr>
  </table>
</div>

原文地址:https://www.cnblogs.com/itecho/p/1307078.html