center flash element based on the elements actual size

…衆ロ難τιáo~ 提交于 2019-12-11 17:08:23

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!