How to dynamically change width of DIV?

0 like 0 dislike
9 views
Tell me how it is possible to dynamically change the width of the DIV depending on how many DIV with a fixed width it invested? For example: the width of the main diva 8500 — it invested 10 DIVов by 800px plus 50 on the indenting. Nested DIVS lined up horizontally. The point is that would not be a lot of scrolling for example when a nested DIV not 10 and 5
by | 9 views

2 Answers

0 like 0 dislike
Well here as though not a lot of options. Wrap/replace all table, or javascript to set the width of the parent. You can still try the version with
\r
\r
#parent{white-space:nowrap;} .child{display:inline-block;} 

with all the consequences, but physically, your posts will not stretch the container.
As for me the easiest way to do this:
\r
$(function(){ var w = 0; $(".child").each(function(){ w += $(this).width(); }); $("#parent").width(w); }); 
by
0 like 0 dislike
Duc stretched the same machine main unit. And no scroll — it stretches the width of the window, and the rest transferred to the next line.
\rnarod.ru/disk/475247001/ololo.html.html
by

Related questions

0 like 0 dislike
2 answers
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
4 answers
110,608 questions
257,186 answers
0 comments
32,830 users