javascript - 当页面向下滚动时,单击一个小图片,那个大图片就在上面了。没有按中间正常显示。
天蓬老师
天蓬老师 2017-04-10 15:12:53
[JavaScript讨论组]


.lightBox{margin-left:50px;width:750px;position: relative;height: 580px;padding: 10px 0;} .lightBox ul{width: 650px} .lightBox li{height: 100px;width: 150px;margin:15px 15px;float: left;overflow: hidden;display: inline;} .lightBox li img{height: 100px;width: 150px; cursor:pointer;} .lightBox b{float:left;position: relative;top:117px;right:96px;} /**弹出层样式***/ .mask{height: 100%;width: 100%;filter:alpha(opacity:0);opacity: 0;background: #000;position: fixed;;z-index: 1;left: 0;top:0;} .popup{background:#fff url(./images/loading.gif) no-repeat center;border: 10px solid #fff;position: absolute;top:50%;left:50%;z-index: 2;;overflow:hidden;width: 320px;height: 240px} .popup img{height: auto;width: auto;} .btn{position: absolute;right: 0;top:0;height: 100%;width: 50%;cursor: pointer;} .prev{left: 0;background: url(./images/lightbox-btn-prev.gif) no-repeat 0 50px;} .next{background: url(./images/lightbox-btn-next.gif) no-repeat right 50px;} .popupBottom{position: relative;z-index: 3;margin-top:8px} .popupTitle,.popupClose{float: right;} .popupTitle{width:100%;line-height: 18px;color: #543424;font-family: Arial;font-size: 12px;margin-right: -81px;width: 100%;_margin:-22px 0 0 0} .popupTitleTxt{float: left;margin-right: 126px} .popupClose{margin-right:15px;height: 22px;width: 66px;background: url(./images/lightbox-btn-close.gif) no-repeat;cursor: pointer;position: relative;z-index: 4}

我就不明白。如果不按页面向下滚动,在900高度可以正常显示,超过900以上的高度,放大的图片怎么不能跟随了?

`



`
天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

全部回复(2)
迷茫

你想要的是这种效果吗?https://jsfiddle.net/dwqs/14gxgsjc/

你可以把弹出层改为position:fixed试试

PHP中文网
  1. position: fixed;
  2. 你的问题很难看懂
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号