I have a DIV
container filled with a dynamic text. The length of the text can be different. The DIV
container has a fixed height but no width.
The Text is formatted as CSS3 Multicolumn Text width a fixed columns-width
.
The result is n
columns with the width of column-width
.
Now i want to know either how many columns are there or how is the computed width
of the DIV
.
CSS CODE:
.columnize{
float: left;
position: relative;
width: 840px;
overflow: hidden;
}
.columnize div{
-moz-column-width: 259px;
-webkit-column-width: 259px;
-moz-column-gap: 16px;
-webkit-column-gap: 16px;
height: 560px;
}
HTML CODE:
<div id="columnWrapper class="columnize">
<div id="content">
... content goes here ...
</div>
</div>
I tried to get the width with JQuery like this:
$('#content').width();
$('#content').innerWidth();
both return the column-width
, not the REAL width
in all browsers except Firefox.
Any ideas how to get the width of the column layout?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…