Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Window.devicePixelRatio

这篇翻译不完整。请帮忙从英语翻译这篇文章

window.devicePixelRatio是一个只读属性,它返回的是一个物理像素在当前显示的设备(垂直)上的一个独立像素的比例。

没有回调函数或者是事件来监听这个值的改变(例如,如果你拖动窗口使其在不同的密度之间显示)

The Window.devicePixelRatio read-only property returns the ratio of the (vertical) size of one physical pixel on the current display device to the size of one device independent pixels(dips).

There are no callbacks or events to listen to when this value changes (for example, if you drag the window between displays with different densities).

语法

value = window.devicePixelRatio;

说明

说明 状态 描述
CSS Object Model (CSSOM) View Module
Window.devicePixelRatio
Working Draft工作草案 初始定义

浏览器兼容

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support ? ? ? ? ?
Feature Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support ? ? ? ? ?

参见

文档标签和贡献者

 此页面的贡献者: zhanghbin, blue0125, Jiang-Xuan
 最后编辑者: zhanghbin,