如何获取x%高度在px? [英] How to get x% height in px?
本文介绍了如何获取x%高度在px?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我给了一个div的100%的高度,我想要的像素的实际高度。
我如何找到该div的高度?
I gave 100% height to a div and I want the actual height in px.
How can I find out the height of that div?
推荐答案
使用jquery你可以使用这个,当容器是div的id:
With jquery you can use this, when container is the id of the div:
$(document).ready(function() {
alert($('#container').height());
});
这篇关于如何获取x%高度在px?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文