使用jquery获取div的高度(以厘米为单位)? [英] getting height of a div in centimeter using jquery?

查看:336
本文介绍了使用jquery获取div的高度(以厘米为单位)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个div,我在其中动态添加数据,我想得到特定div的高度,以厘米为单位。因为我需要根据高度控制可以在div中显示的数据量。

I'm having a div , in which I am adding data dynamically, I want to get the height of the particular div in centimeter. Because I need to control the amount of data that can be displayed in that div based on the height.

推荐答案

1px = 0.02645833 cm;

1 cm = 37.795276px;

请参阅以下链接:

如何通过javascript访问屏幕显示的DPI设置?

如何使用JavaScript检测屏幕DPI

Pixel to Centimeter?

这篇关于使用jquery获取div的高度(以厘米为单位)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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