单击图片实现“原图比例展示、上一张、下一张”类似相册的效果

效果:将某一页面的图片收集在一起,实现单击任何一张图片,按原图片比例进行适当的缩放并在浏览器正中进行显示,有上一张、下一张功能。

<style type="text/css">
    body{}
    #imgexp{width:800px;height:500px;background:#000000;border:solid 10px #8B8B83;filter:alpha(opacity=70);-moz-opacity:0.7;opacity:0.7;position:fixed;top:20px;left:320px;z-index:190;}
    #imgexp table{width:750px;height:450px;margin-left:25px;margin-top:25px;overflow:hidden;}
    #imgexp .img_show{}
    #imgexp #close{width:30px;height:30px;position:absolute;top:-20px;right:-20px;z-index:191;cursor:pointer;}

   //覆盖层,使点击图片后后面的页面不能操作
    #layer{z-index:10;width:100%;height:100%;position:fixed;background:#575757;top:0;left:0;filter:alpha(opacity=50);-moz-opacity:0.5;opacity:0.5;}
    #imgexp #previous{position:absolute;top:45%;left:10px;cursor:pointer;}
    #imgexp #next{position:absolute;top:45%;right:10px;cursor:pointer;}
    </style>
    <script type="text/javascript" src="JS/jquery.js"></script>
    <script type="text/javascript">
    var imgArray=new Array();
    var img_current;
   
    //用于初始化显示被点击的图像
    function img_init(Img)
    {
      var img = new Image();
      img.src = Img.src;
      var width&

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值