V
V
Vladislav Vasiliev2015-12-04 19:18:00
Google
Vladislav Vasiliev, 2015-12-04 19:18:00

How to specify the width of a hidden dynamic div?

There is bootstrap, I made panels (tabs) in it, the first panel displays a chart from google charts (div), the size of which is set via JS like this:

$(window).resize(function(){
            drawChart2();
        });

That is, when the window size is changed, the graph size is changed. So, on the second tab there is also a graph, but it is hidden, and when I open this tab, it can be seen that the size of the graph is very small. If you change the size of the browser window, the graph becomes normal. How to fix?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
rtf_const, 2015-12-05
@rtf_const

Display the div, draw the graph, then hide the div. If everything happens synchronously - the user will not see anything, the browser redraw is performed after the completion of all operations, but the size is recalculated after each DOM change

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question