CSS jqzoom对齐问题
您好,我已经设置了一个画廊,其中图像以缩略图形式列出在主图像旁边,而主图像又可以由用户缩放。
然而,由于某种原因,当我使用 3 个缩略图(4 个与主图像完美对齐)时,它们不是从 div 顶部列出,而是从底部对齐,因此网页看起来像:
________
| |
_ | |
|_|| |
_ | |
|_|| |
_ | |
|_||_______|
而不是
_ ________
|_|| |
_ | |
|_|| |
_ | |
|_|| |
| |
|_______|
我的 css 是:
.clearfix:after{clear:both;content:".";display:block;font-size:0;height:0;line-height:0;visibility:hidden;}
.clearfix{display:block;zoom:1}
ul#thumblist{display:block; margin-left:-40px;}
ul#thumblist li{float:left;margin-right:6px; margin-bottom:4px; margin-top:-2px;list-style:none;}
ul#thumblist li a{display:block;border:1px solid #666}
ul#thumblist li a.zoomThumbActive{
border:1px solid #F7941E;
}
我的 html 是:
<table border>
<tr>
<td width="101" rowspan="4"><div class="clearfix" >
<ul id="thumblist" class="clearfix" >
<li><a class="zoomThumbActive" href='javascript:void(0);' rel="{gallery: 'gal1', smallimage: './imgProd/1.jpg',largeimage: './imgProd/1.jpg'}"><img src='imgProd/1.jpg' style="width:110px; height:110px;"></a></li>
<li><a href='javascript:void(0);' rel="{gallery: 'gal1', smallimage: './imgProd/2.jpg',largeimage: './imgProd/2.jpg'}"><img src='imgProd/2.jpg' style="width:110px; height:110px;"></a></li>
<li><a href='javascript:void(0);' rel="{gallery: 'gal1', smallimage: './imgProd/3.jpg',largeimage: './imgProd/3.jpg'}"><img src='imgProd/3.jpg' style="width:110px; height:110px;"></a></li>
<li><a href='javascript:void(0);' rel="{gallery: 'gal1', smallimage: './imgProd/4.jpg',largeimage: './imgProd/4.jpg'}"><img src='imgProd/4.jpg' style="width:110px; height:110px;"></a></li>
</ul>
</div></td>
<td width="450" rowspan="4"><div class="clearfix">
<a href="imgProd/1.jpg" class="jqzoom" rel='gal1' title="" >
<img src="imgProd/1.jpg" title="" style="border:2px solid #F7941E;-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.5); width:450px; height:450px;">
</a>
</div></td>
<td></td>
</tr>
</table>
为什么图像不会从 div/table 的顶部垂直对齐,而不是从底部对齐?任何帮助非常感谢!
谢谢 京东
Hi I have setup a gallery where images are listed in thumbnails alongside the main image which can in turn be zoomed by the user.
However, for some reason, when I use 3 thumbnails (4 align perfectly with the main image), instead of listing them from the top of the div, they are aligned from the bottom so the webpage looks like:
________
| |
_ | |
|_|| |
_ | |
|_|| |
_ | |
|_||_______|
instead of
_ ________
|_|| |
_ | |
|_|| |
_ | |
|_|| |
| |
|_______|
My css is:
.clearfix:after{clear:both;content:".";display:block;font-size:0;height:0;line-height:0;visibility:hidden;}
.clearfix{display:block;zoom:1}
ul#thumblist{display:block; margin-left:-40px;}
ul#thumblist li{float:left;margin-right:6px; margin-bottom:4px; margin-top:-2px;list-style:none;}
ul#thumblist li a{display:block;border:1px solid #666}
ul#thumblist li a.zoomThumbActive{
border:1px solid #F7941E;
}
and my html is:
<table border>
<tr>
<td width="101" rowspan="4"><div class="clearfix" >
<ul id="thumblist" class="clearfix" >
<li><a class="zoomThumbActive" href='javascript:void(0);' rel="{gallery: 'gal1', smallimage: './imgProd/1.jpg',largeimage: './imgProd/1.jpg'}"><img src='imgProd/1.jpg' style="width:110px; height:110px;"></a></li>
<li><a href='javascript:void(0);' rel="{gallery: 'gal1', smallimage: './imgProd/2.jpg',largeimage: './imgProd/2.jpg'}"><img src='imgProd/2.jpg' style="width:110px; height:110px;"></a></li>
<li><a href='javascript:void(0);' rel="{gallery: 'gal1', smallimage: './imgProd/3.jpg',largeimage: './imgProd/3.jpg'}"><img src='imgProd/3.jpg' style="width:110px; height:110px;"></a></li>
<li><a href='javascript:void(0);' rel="{gallery: 'gal1', smallimage: './imgProd/4.jpg',largeimage: './imgProd/4.jpg'}"><img src='imgProd/4.jpg' style="width:110px; height:110px;"></a></li>
</ul>
</div></td>
<td width="450" rowspan="4"><div class="clearfix">
<a href="imgProd/1.jpg" class="jqzoom" rel='gal1' title="" >
<img src="imgProd/1.jpg" title="" style="border:2px solid #F7941E;-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.5); width:450px; height:450px;">
</a>
</div></td>
<td></td>
</tr>
</table>
Why wont the images align vertically from the top of the div/table as opposed to aligning from the bottom? Any help much appreciated!!
Thanks
JD
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该能够使用
示例: http://jsfiddle.net/7fp8s/
You should just be able to use
Example: http://jsfiddle.net/7fp8s/