两张图像显示在一个灯箱中
我必须使用以下代码进行成像:
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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有 2 个选项,具体取决于您使用的灯箱:
某些灯箱(colorbox、DOM 窗口、facybox、thickbox)支持将 html 页面加载到 iframe 中,而不仅仅是图像。如果您可以尝试将带有这两个标签的 html 加载到 lightbox 中。
如果您有一个仅支持图像的灯箱(例如 squarespace 的蹩脚灯箱),您可能必须使用 PHP 的 GD 库将图像合并在一起。
看这个问题:
在服务器上将两个图像合并在一起,然后保存
There are 2 options, depending on the lightbox you're using:
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.
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