discuz 图片放大效果

分享时间:2018-12-26 9392 热度℃
图片img行内加上onclick="zoom(this, this.src, 0, 0, 0)"

  1. <img src="{$doc['pic']}" onclick="zoom(this, this.src, 0, 0, 0)"/>
复制代码


css
  1. .zoominner { padding: 5px 10px 10px; background:#fff; text-align: left; }
  2. .zoominner p { padding: 8px 0; }
  3. .zoominner p a { float: left; margin-left: 10px; width: 17px; height: 17px; background: url({IMGDIR}/imgzoom_tb.gif) no-repeat 0 0; line-height: 100px; overflow: hidden; }
  4. .zoominner p a:hover { background-position: 0 -39px; }
  5. .zoominner p a.imgadjust { background-position: -40px 0; }
  6. .zoominner p a.imgadjust:hover { background-position: -40px -39px; }
  7. .zoominner p a.imgclose { background-position: -80px 0; }
  8. .zoominner p a.imgclose:hover { background-position: -80px -39px; }
  9. .zimg_c { position: relative; }
  10. .zimg_prev, .zimg_next { display: block; position: absolute; width: 80px; height: 100%; background: url({IMGDIR}/pic-prev.png) no-repeat 0 -100px; cursor: pointer; }
  11. .zimg_next { right: 10px; background-image: url({IMGDIR}/pic-next.png); background-position: 100% -100px; }
  12. .zimg_c img { margin: 0 auto; }
  13. .zimg_p strong { display: none; }
复制代码


即可实现帖子内容页里点击图片放大效果。

zoom()在common.js里,全站可用。
返回顶部