问题
I have a problem positioning a Flash element inside a div tag. The problem is, that the flash element is changing it's size based on the user input. I need a way how I can dynamically get the actual size of the flash element, and to change the behavior of the div element the flash is integrated in. actually I want to place it in the middle of the div.
right now I gave the flash element width and height of 100% but that way I can not center the element inside the div...
Any solution? I might need javascript right? Im a newby in javascript!
Maechi
回答1:
If there's no interaction needed with surroundings of flash, you could include transparent 100% wide and 100% height flash and resize and position moviechild in it through flashvars
回答2:
if you have:
<div id="container">
<object id="#flash">...</object>
</div>
you can try this css:
#container {
width: <larger or equeals than max flash width>px;
}
#flash {
margin: 0 auto;
}
来源:https://stackoverflow.com/questions/2355481/center-flash-element-based-on-the-elements-actual-size