gpt4 book ai didi

javascript - window.devicePixelRatio 浏览器支持

转载 作者:可可西里 更新时间:2023-11-01 01:19:10 25 4
gpt4 key购买 nike

我一直在网上寻找浏览器对 window.devicePixelRatio 的支持,但运气不佳。

有谁知道哪些浏览器/设备支持这个?

最佳答案

根据 this博文:(自 2012 年起)

  • window.devicePixelRatio 在大多数浏览器上都是值得信赖的。
  • 在 iOS 设备上,将 devicePixelRatio 乘以 screen.width 以获得物理像素数。
  • 在 Android 和 Windows Phone 设备上,将 screen.width 除以 devicePixelRatio 以获得倾斜计数。

2017 年更新:

This property returns the ratio of the resolution in physical pixels to the resolution in CSS pixels for the current display device. This value could also be interpreted as the ratio of pixel sizes: the size of one CSS pixel to the size of one physical pixel.

桌面浏览器支持:

Chrome    Edge    Firefox    Internet Explorer    Opera    Safari49        (Yes)   49         11                   41       9.1

移动浏览器:

Android     Edge    Firefox     IE Mobile   Opera   Safari Mobile4.4         (Yes)   ?           ?           all     9.3

Draft Spec

关于javascript - window.devicePixelRatio 浏览器支持,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16385573/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com