1 reply [Last post]
firstmate
firstmate's picture
User offline. Last seen 1 year 47 weeks ago. Offline
newbie
Timezone: GMT-6
Joined: 2010-03-14
Posts: 2
Points: 3

I have a canvas being generated from javascript that also sets it's width & height.
map.innerHTML="<canvas id='map_canvas' width="+tile_width*map_width+" height="+tile_height*map_height+"></canvas>";

Now the width/height sometimes overflow beyond the parent's set width/height (if the dimensions are large enough) which is 1000x580.

I tried to set, 'overflow: auto' to the parent, but it does not do anything.
Setting 'max-width' works for Google Chrome, but not anything else and does produce a horizontal scrollbar.

To view what I mean, please go to: http://firstmate.neo1211.com/pt/index3canvas.html
There should be a window called 'New Map' inside the webpage. Enter dimensions such as 30x30 and it will produce a map that overflows past it's parent.

Any help is much appreciated?

firstmate
firstmate's picture
User offline. Last seen 1 year 47 weeks ago. Offline
newbie
Timezone: GMT-6
Joined: 2010-03-14
Posts: 2
Points: 3

Nevermind, I figured out a

Nevermind, I figured out a way around it by adding a

tag with the overflow: auto CSS property. This seemed to do the trick.