javascript - How to determine how many CSS3 columns are actually being displayed (vs. the specified column-count)? -


i have list of tags in box i've specified having multiple columns:

#tags {   -webkit-columns: 140px 5; } 

result:

screenshot - 5 columns

the content of list dynamically generated.

when resize browser window, number of columns collapses. e.g.:

enter image description here

using jquery / js / css / etc., how can determine how many columns being displayed @ given time?

unless specified column width-related properties browsers try fit whole number of columns in content area (between left , right padding of element). (contentwidth + columngap)/(columnwidth + columngap) rounded down give result.

note right padding may set high whole column able fit there - may need adjust computations.

you can directly size of column if have element 100% width inside columns text.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -