CSS jqzoom对齐问题

发布于 2024-12-09 22:26:58 字数 2498 浏览 0 评论 0原文

您好,我已经设置了一个画廊,其中图像以缩略图形式列出在主图像旁边,而主图像又可以由用户缩放。

然而,由于某种原因,当我使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

束缚m 2024-12-16 22:26:58

您应该能够使用

tr{
    vertical-align:top;
}

示例: http://jsfiddle.net/7fp8s/

You should just be able to use

tr{
    vertical-align:top;
}

Example: http://jsfiddle.net/7fp8s/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文