A
Aaron Gray
Hi,
How do I get the size of a <div> in JavaScript, given :-
Note I am missing out the <html>/<body>/<script> sections here
~~~
<div id="canvas"
style="background-color:#f0f0f0;position:relative;height:100%;width:100%;"
onresizeend="drawAll();"></div>
~~~
var h = canvas.height;
drawChart(h);
~~~
function drawAll()
{
h = canvas.height;
drawChart( h)
}
~~~
If I do an alert() to print out 'h' it is coming out as 'undefined'.
I am probably doing something simple wrong.
Hope you can help,
Aaron
How do I get the size of a <div> in JavaScript, given :-
Note I am missing out the <html>/<body>/<script> sections here
~~~
<div id="canvas"
style="background-color:#f0f0f0;position:relative;height:100%;width:100%;"
onresizeend="drawAll();"></div>
~~~
var h = canvas.height;
drawChart(h);
~~~
function drawAll()
{
h = canvas.height;
drawChart( h)
}
~~~
If I do an alert() to print out 'h' it is coming out as 'undefined'.
I am probably doing something simple wrong.
Hope you can help,
Aaron