检测图像是在 iframe 中显示还是单独显示
我正在构建一个系统,允许人们通过 thickbox 查看图片。但我有一个问题。通过PHP和普通HTML直接显示thickbox中的图片。它的显示没有任何 CSS 界面,页面只是查看普通图片。如果通过厚盒查看图片,这很好。但如果用户想同时打开一张以上的图片,用户可能会在新标签页上打开图片,在这种情况下,图片将显示在页面上,而不显示任何内容。那看起来不太好。
如何检测用户是通过厚盒查看图片还是通过整个浏览器作为整页查看图片?
I am building a system that allows people to view pictures through thickbox. But I have a problem. The picture in the thickbox gets displayed directly through PHP and normal HTML. It gets displayed without any CSS interface and the page just views the plain picture. This is fine if the picture is viewed through the thickbox. But if the user wanted to open more than 1 picture at the same time, the user might open the pics on new tabs, and in this case the picture will be displayed on the the page without anything. And that won't look good.
How can I detect if the user is viewing the picture through the thickbox or through the whole browser as a full page?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
解决此问题的方法是修改
view_picture.php
文件以包含一个参数,该参数说明视图当前采用的格式。例如:请注意添加
&view =thickbox
到href
属性然后在您的
view_picture.php
中添加如下内容:A solution to this would be to modify your
view_picture.php
file to include an argument that states what format the view is currently in. For example:Note the addition of
&view=thickbox
to thehref
attributeThen in your
view_picture.php
something like the following: