我可以禁用 Firefox吗? 在每个图像的基础上使用 CSS 进行图像缩放?

发布于 2024-07-16 17:46:48 字数 117 浏览 6 评论 0原文

在我的网页上,有两次我不希望 Firefox 在放大和缩小时自动缩放图像。

我可以在这些图像上专门规避此功能,并让其余图像在 Firefox 中正常缩放(如果这是用户在他/她的首选项中设置的内容)吗?

There are two occasions on my web page where I don't want Firefox to automatically scale the images when zooming in and out.

Can I circumvent this feature on these images specifically, and have the rest of the images zoom as normal in Firefox (if that's what the users has set in his/her preferences)?

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

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

发布评论

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

评论(1

弥繁 2024-07-23 17:46:48

当用户请求缩放时,无法标记或以其他方式阻止图像被缩放。

您可以使用 window.onresize 并使用其中一种技术检测缩放量在 Firefox 3(及其他版本)中检测页面缩放中进行了描述。 一旦您知道缩放量,您就可以将该百分比调整应用于您想要保留固定尺寸的图像。

不过,整件事都是纸牌屋。 仅 JavaScript 解决方案在页面首次加载时不会检测缩放量,因此您需要在页面上安装 Flash 组件来检测缩放量。 此外,缩放的实际效果会让用户感到不舒服。 图像大小调整将稍微滞后于用户的缩放设置,导致页面重排,可能会移动他们首先尝试放大的内容。

There is no way to mark or otherwise prevent an image from being zoomed when the user requests zooming.

You could use window.onresize and detect the zoom amount using one of the techniques described at Detecting Page Zoom in Firefox 3 (And Others). Once you know the zoom amount, you could apply that percentage adjustment to the images you want to leave at a fixed size.

The whole thing is a house of cards though. The JavaScript-only solution does not detect zoom amount when the page is first loaded, so you'll need a Flash component on the page just to detect the zoom amount. Also, the actual effect of the zooming will be jarring for the user. The image resizing will lag slightly behind the user's zoom setting, causing the page to reflow, possibly moving the content they were trying to zoom in on in the first place.

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