如何显示全尺寸的图像 [英] How to display an image full size

查看:103
本文介绍了如何显示全尺寸的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<a href="FullSize.jpg"><img alt="thumb" src="thumb.jpg"></a>

点击上面的拇指时,浏览器将显示FullSize.jpg的大小以适应客户端的窗口浏览器,当光标移到它上面时,+将出现,表示单击图像将显示其全尺寸。我想要做的是首先显示图像的全尺寸,而不需要用户点击它以获得完整的尺寸。如何做到这一点?

When the above thumb is clicked the browser will display FullSize.jpg sized to fit the client window of the browser and when the cursor moves over it a '+' will appear to signify that clicking the image will display it full size. What I want to do is display the image full size in the first place, without requiring the user to click it to get full size. How does one do this?

推荐答案

不幸的是,您所描述的是浏览器UI功能(或错误的观点),并且只能由用户启用/禁用。通常通过'编辑首选项'选项。

Unfortunately, what you describe is a browser UI feature (or 'bug,' depending on your point of view), and can only be enabled/disabled by the user. Usually via the 'edit preferences' options.

只有当图像的全尺寸大于视图端口时,才能看到满的图像图像无需滚动,它完成了实时,因此图像本身不被压缩/调整大小,只是缩放以适应视口。用户只需点击一次即可立即进行直观的操作。我不确定,如果有解决方法,我可以推荐这样一种技术,尤其是因为它是一个我更喜欢的功能,作为开发人员用户,比我感到不满。

It's only done if the image at its full size is larger than the view-port, so that the user can see the full image without having to scroll around, it's done 'live' so the image itself isn't compressed/resized, just scaled to fit the viewport. It's also immediately, and intuitively, un-doable by the user in just one-click. I'm not sure that, if there were a way around it, I could recommend such a technique, especially since it's a feature that I'm happy with far more often, as a developer and user, than I'm displeased by it.

围绕它的唯一方法是,我能想到的是找到图像的原始高度/宽度,并将其包装在div中这些尺寸(加上一点填充)。我不确定它会起作用,但是现在我正在考虑它是唯一想到的事情。

The only way around it, that I can think of is to find the image's native height/width, wrap it in a div with those dimensions (plus a little padding). I'm not sure that it will work, but it's the only thing that comes to mind now I'm thinking about it.

这篇关于如何显示全尺寸的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆