获取屏幕的PDI值
在设计获取元素的精确样式值第三版的过程中,需要有到PDI值。参考hax的函数,搞出这个:
var DPI = window.screen.logicalXDPI || (function(){ var el = document.createElement("div"),s = el.style, root = document.documentElement s.margin = s.borderWidth = s.padding = '0' s.maxWidth = s.minWidth = s.width = '1in' root.insertBefore(el,null); return s.pixelWidth || parseInt(window.getComputedStyle(el,null).width) })() ;
机器瞎学/数据掩埋/模式混淆/人工智障/深度遗忘/神经掉线/计算机幻觉/专注单身二十五年