问题 2012-02-10 19:16:27 点击:35234
[JS&JQUERY] 一个JQuery获取DIV高度的问题
前台有一个<div id="content">
div里面的内容不是固定的,所以高度也不是固定的,在DIV的样式里面也没有写height属性;然而在JavaScript里面怎么取它的当前高度?
我试过用JQuery的$("#content").css("height")去取,但是取出来的是auto;
也试过用document.getElementById("content").style.height去取,取出来是一个空字符串;
我的问题就是:怎么取它当前的具体高度?比如400px.
推荐答案 2012-02-10 19:16:27
jquery有一个专门的height属性,$("#content").height()就可以了!
- 1楼 学PHPER说: 2012-11-14 15:05:52
-
可去爱微教程网解决你这个问题 www.iiwnet.com
- 2楼 学PHPER说: 2013-02-27 21:35:10
-
88952634
- 3楼 学PHPER'`"(说: 2013-02-27 21:35:12
-
88952634
- 4楼 学PHPER-0说: 2013-02-27 21:35:14
-
88952634
- 5楼 学PHPERs3说: 2013-02-27 21:35:14
-
88952634
- 6楼 学PHPER'+'说: 2013-02-27 21:35:15
-
88952634
- 7楼 学PHPER'说: 2013-02-27 21:35:15
-
88952634
- 8楼 学PHPER'||'说: 2013-02-27 21:35:16
-
88952634
- 9楼 学PHPER'说: 2013-02-27 21:35:17
-
88952634
- 10楼 学PHPER<alert(88952634)>说: 2013-02-27 21:35:17
-
88952634
- 11楼 学PHPER说: 2013-02-27 21:35:18
-
88952634
- 12楼 学PHPER说: 2013-02-27 21:35:19
-
88952634
- 13楼 学PHPER说: 2013-02-27 21:35:20
-
88952634
- 14楼 学PHPER说: 2013-02-27 21:35:20
-
88952634
- 15楼 学PHPER说: 2013-02-27 21:35:21
-
88952634
- 16楼 学PHPER说: 2013-02-27 21:35:22
-
88952634
- 17楼 学PHPER说: 2013-02-27 21:35:23
-
88952634
- 18楼 学PHPER说: 2013-02-27 21:35:23
-
88952634
- 19楼 学PHPER说: 2013-02-27 21:35:24
-
88952634
- 20楼 学PHPER说: 2013-02-27 21:35:32
-
88952634'`"(
- 21楼 学PHPER说: 2013-02-27 21:35:33
-
88952634-0
- 22楼 学PHPER说: 2013-02-27 21:35:33
-
88952634s3
- 23楼 学PHPER说: 2013-02-27 21:35:34
-
88952634'+'
- 24楼 学PHPER说: 2013-02-27 21:35:38
-
88952634'
- 25楼 学PHPER说: 2013-02-27 21:35:38
-
88952634'||'
- 26楼 学PHPER说: 2013-02-27 21:35:39
-
88952634'
- 27楼 学PHPER说: 2013-02-27 21:35:40
-
88952634<alert(88952634)>
- 28楼 Alexavier说: 2016-09-09 15:37:17
-
Amen to that. And beware the CD who noodles your spot endlessly. this is a clear sign that they don't know what the f**k they are doing. periicteonfsm is just insecurity in a fancy frock. avoid it at all costs. a few imperfections on the veneer can be a good thing. you can polish the life out of an idea.
发表评论