图片缩小放大脚本

 <html>
<head>
<title>中国室内设计师网-查看图片</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href='/Skin/DefaultSkin.css' rel='stylesheet' type='text/css'>
<script language=JavaScript>
function smallit(){           
 var height1=PhotoViewer.images1.height;           
 var width1=PhotoViewer.images1.width;           
 PhotoViewer.images1.height=height1/1.2;           
 PhotoViewer.images1.width=width1/1.2;          
}            
         
function bigit(){           
 var height1=PhotoViewer.images1.height;           
 var width1=PhotoViewer.images1.width;           
 PhotoViewer.images1.height=height1*1.2;         
 PhotoViewer.images1.width=width1*1.2;          
}            
function fullit()
{
 var width_s=screen.width-10;
 var height_s=screen.height-30;
 window.open("Photo_View.asp?UrlID=1&PhotoID=26", "PhotoView", "width="+width_s+",height="+height_s+",left=0,top=0,location=no,toolbar=no,status=no,resizable=no,scrollbars=yes,menubar=no,directories=no");
}
function realsize()
{
 PhotoViewer.images1.height=PhotoViewer.images2.height;    
 PhotoViewer.images1.width=PhotoViewer.images2.width;
 PhotoViewer.block1.style.left = 0;
 PhotoViewer.block1.style.top = 0;
 
}
function featsize()
{
 var width1=PhotoViewer.images2.width;           
 var height1=PhotoViewer.images2.height;           
 var width2=760;           
 var height2=500;           
 var h=height1/height2;
 var w=width1/width2;
 if(height1<height2&&width1<width2)
 {
  PhotoViewer.images1.height=height1;           
  PhotoViewer.images1.width=width1;          
 }
 else
 {
  if(h>w)
  {
   PhotoViewer.images1.height=height2;         
   PhotoViewer.images1.width=width1*height2/height1;          
  }
  else
  {
   PhotoViewer.images1.width=width2;          
   PhotoViewer.images1.height=height1*width2/width1;         
  }
 }
 PhotoViewer.block1.style.left = 0;
 PhotoViewer.block1.style.top = 0;
}
</script>  

 <tr>
    <td height="30" align="center" valign="middle" Class="left_tdbgall">
 <input name="smallit" type="button" id="smallit" οnclick="smallit();" value="- 缩小 -">&nbsp;&nbsp;
 <input name="bigit" type="button" id="bigit" οnclick="bigit();" value="+ 放大 +" >&nbsp;&nbsp;
 <input name="fullit" type="button" id="fullit" onClick="fullit();" value="全屏显示">&nbsp;&nbsp;
 <input name="realsize" type="button" id="realsize" onClick="realsize();" value="实际大小">&nbsp;&nbsp;
 <input name="featsize" type="button" id="featsize" onClick="featsize();" value="最合适大小">&nbsp;&nbsp;
 <span class="tdbg_leftall">
 <input name='Prev' type='button' id='Prev' value='上一张' onClick="javascript:window.open('Photo_Viewer.asp?PhotoID=24', '_self');">
 &nbsp;
 <input name='Next' type='button' id='Next' value='下一张' onClick="javascript:window.open('Photo_Viewer.asp?PhotoID=30', '_self');">
 </span>
 </td>
  </tr>
  <tr>
    <td height="500" align="center" valign="middle" Class="left_tdbgall">
 <iframe id='PhotoViewer' width='99%' height='500' scrolling='no' src='Photo_View.asp?UrlID=1&PhotoID=26'></iframe>
 </td>
  </tr>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值