Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scale div in an upwards direction, instead of down?

I have a custom info window over a google map, sometimes these info windows contain an image. When they do, the info window scales down over the marker it is positioned over as soon as the image has finished loading.

So the images take longer to load and the div's position has already been calculated by the time the image is finished loading.

I do believe there is a way of checking if an image has finished loaded, but that seems a long route - is there not a simple way with JS or CSS to get the div to scale upwards instead of down.

Anyone have any clues?

like image 498
CodeChap Avatar asked Jun 12 '10 08:06

CodeChap


People also ask

How do I force a div to the bottom?

Set the position of div at the bottom of its container can be done using bottom, and position property. Set position value to absolute and bottom value to zero to placed a div at the bottom of container.

How do you scale a div in CSS?

scale() The scale() CSS function defines a transformation that resizes an element on the 2D plane. Because the amount of scaling is defined by a vector, it can resize the horizontal and vertical dimensions at different scales. Its result is a <transform-function> data type.

How do I move a div to the right side?

Use CSS property to set the height and width of div and use display property to place div in side-by-side format. float:left; This property is used for those elements(div) that will float on left side. float:right; This property is used for those elements(div) that will float on right side.


1 Answers

Use absolute positioning and instead of setting the offset with top use bottom. With this property you can ensure the position of the bottom edge of your div - any change in size will force the div to expand upwards.

like image 96
Finbarr Avatar answered Oct 10 '22 14:10

Finbarr