两张图像显示在一个灯箱中

发布于 2024-11-29 11:42:45 字数 722 浏览 2 评论 0原文

我必须使用以下代码进行成像:

  echo '<div class="thumb" style="width: '.$array['thumb_width'].'px; height: '.$array['thumb_height'].'px;">
            <a class="lightbox" width="72" height="72" href="showfile.php?image_id='.$array['before_image_id'].'" >
            <img src="showthumbs.php?image_id='.$array['before_image_id'].'"/">
            </a>

            <a class="lightbox" width="72" height="72" href="showfile.php?image_id='.$array['after_image_id'].'" >
            <img src="showthumbs.php?image_id='.$array['after_image_id'].'"/">
            </a>

            </div><p><p/>';

问题是它在灯箱中单独显示。我希望它在一个灯箱中并排显示两个图像。我该如何做到这一点?

I have to image with the following code:

  echo '<div class="thumb" style="width: '.$array['thumb_width'].'px; height: '.$array['thumb_height'].'px;">
            <a class="lightbox" width="72" height="72" href="showfile.php?image_id='.$array['before_image_id'].'" >
            <img src="showthumbs.php?image_id='.$array['before_image_id'].'"/">
            </a>

            <a class="lightbox" width="72" height="72" href="showfile.php?image_id='.$array['after_image_id'].'" >
            <img src="showthumbs.php?image_id='.$array['after_image_id'].'"/">
            </a>

            </div><p><p/>';

The issue is that it is displayed separately in the lightbox. I want it to show two image side by side in one lightbox.. How do I do this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

假装爱人 2024-12-06 11:42:45

有 2 个选项,具体取决于您使用的灯箱:

  1. 某些灯箱(colorbox、DOM 窗口、facybox、thickbox)支持将 html 页面加载到 iframe 中,而不仅仅是图像。如果您可以尝试将带有这两个标签的 html 加载到 lightbox 中。

  2. 如果您有一个仅支持图像的灯箱(例如 squarespace 的蹩脚灯箱),您可能必须使用 PHP 的 GD 库将图像合并在一起。
    看这个问题:
    在服务器上将两个图像合并在一起,然后保存

There are 2 options, depending on the lightbox you're using:

  1. Some lightboxes (colorbox, DOM window, facybox, thickbox) support loading html pages into an iframe rather than just images. If you can try loading html with the two tags into the lightbox.

  2. If you have a lightbox that only supports images (like squarespace's crappy lightbox) you may have to merge the images together using PHP's GD library.
    See this question:
    Merge Two images together on Server, then save

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