0

I have a canvas element that changes in height after some user interaction. The canvas is contained in a div. When the canvas changes in height, it currently overflows the div vertically.

Can I add a (javascript or jquery) listener (or something like that) to the height of the canvas, that dynamically changes the div's height according to the canvas height? Or is there a css way to let the div automatically enlarge (like in a table row).

thanks

4

2 に答える 2

1

Have you tried adding this style to the div : height:auto;

于 2012-05-08T19:02:17.810 に答える
0

As a workaround, I've put the canvas in a table. A bit ugly, but it works.

于 2012-05-09T06:49:47.743 に答える