Foros del Web » Creando para Internet » HTML »

Centrar swf vertical y horizontalmente en pantalla

Estas en el tema de Centrar swf vertical y horizontalmente en pantalla en el foro de HTML en Foros del Web. Hola he buscado muchos post en el foro pero no he dado con la solución. Tengo un swf en una tabla y quuiero que me ...
  #1 (permalink)  
Antiguo 27/09/2006, 03:40
Avatar de Laika  
Fecha de Ingreso: octubre-2001
Mensajes: 1.376
Antigüedad: 22 años, 6 meses
Puntos: 0
Centrar swf vertical y horizontalmente en pantalla

Hola he buscado muchos post en el foro pero no he dado con la solución.

Tengo un swf en una tabla y quuiero que me parezca centrado en pantalla.
He conseguido que quede centrado horizontalmente pero no verticalmente.

QUiero que este centrado horizontalmente y verticalmente para todas las resoluciones. Que aparezca justo en el centro d ela pantalla.

Haber si sabeis hacerlo,

Gracias
  #2 (permalink)  
Antiguo 27/09/2006, 06:06
Avatar de jcxnet  
Fecha de Ingreso: octubre-2005
Ubicación: Perú
Mensajes: 784
Antigüedad: 18 años, 6 meses
Puntos: 56
En este link puedes ver una posible solución usando css:
http://www.wpdfd.com/editorial/thebox/deadcentre4.html
__________________
►I'm a devil on the run ♂
Jcxnet.com
*Keep It Simple **
  #3 (permalink)  
Antiguo 28/09/2006, 03:58
Avatar de Laika  
Fecha de Ingreso: octubre-2001
Mensajes: 1.376
Antigüedad: 22 años, 6 meses
Puntos: 0
Gracias por el Link. tengo un problema. Este es el codigo que me has pasado:

Cita:

<html>

<head>
<meta http-equiv="content-type" content="text/html;charset=ISO-8859-1">
<title>Dead Centre</title>
<style type="text/css" media="screen"><!--
body
{
color: white;
background-color: #003;
margin: 0px
}

#horizon
{
color: white;
background-color: #0ff;
text-align: center;
position: absolute;
top: 50%;
left: 0px;
width: 100%;
height: 1px;
overflow: visible;
visibility: visible;
display: block
}

#content
{
font-family: Verdana, Geneva, Arial, sans-serif;
background-color: #f00;
margin-left: -125px;
position: absolute;
top: -35px;
left: 50%;
width: 250px;
height: 70px;
visibility: visible
}


.headline
{
font-weight: bold;
font-size: 24px
}

#footer
{
font-size: 11px;
font-family: Verdana, Geneva, Arial, sans-serif;
text-align: center;
position: absolute;
bottom: 0px;
left: 0px;
width: 100%;
height: 20px;
visibility: visible;
display: block
}

a:link, a:visited
{
color: #06f;
text-decoration: none
}

a:hover
{
color: red;
text-decoration: none
}

.captions
{
color: white;
font-size: 10px;
line-height: 14px;
font-family: Verdana, Geneva, Arial, sans-serif;
text-align: left
}

--></style>
</head>

<body>
<div id="horizon">
<div id="content">


</div>
</div>
<div id="footer">
<a href="deadcentre3.html">
back</a></div>

</body>

</html>
Lo que necesito ahora es meter en la capa <div id="content"> lo siguiente:

Cita:

<table width="780" border="0" cellspacing="0" cellpadding="0">
<tr>
<th scope="row">sd</th>
</tr>
<tr>
<th scope="row"><table width="780" height="317" border="1" align="center" cellpadding="0"
cellspacing="0" bordercolor="#eeeeee" bgcolor="#FFFFFF" valign="middle">
<tr>
<td height="317" valign="top"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="780" height="317">
<param name="movie" value="montajes/index/index.swf" />
<param name="quality" value="high" />
<embed src="montajes/index/index.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="780" height="317"></embed>
</object></td>
</tr>
</table></th>
</tr>
<tr>
<th scope="row">sd</th>
</tr>
</table>
Al meterlo ya o me queda centrado
  #4 (permalink)  
Antiguo 28/09/2006, 08:31
Avatar de jcxnet  
Fecha de Ingreso: octubre-2005
Ubicación: Perú
Mensajes: 784
Antigüedad: 18 años, 6 meses
Puntos: 56
Información Pequeños cambios

Claro... tienes que hacer unos cambios:
1° - No uses la tabla, solo el objeto flash, entonces dentro del div "content" escribes:
Código HTML:
<div id="content">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="780" height="317">
<param name="movie" value="montajes/index/index.swf" />
<param name="quality" value="high" />
<embed src="montajes/index/index.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="780" height="317"></embed>
</object>
</div> 
2° - Hay que modificar el tamaños del div para que se ajuste a tu flash, si te fijas en las propiedades del estilo del div "content":
Cita:
#content
{
font-family: Verdana, Geneva, Arial, sans-serif;
background-color: #f00;
margin-left: -125px;
position: absolute;
top: -35px;
left: 50%;
width: 250px;
height: 70px;
visibility: visible
}
las propiedades top y margin-left son la mitad del valor de width y height; entonces para ajustar el tamaño de tu flash debería quedar así:
Cita:
#content
{
font-family: Verdana, Geneva, Arial, sans-serif;
background-color: #f00;
margin-left: -390px;
position: absolute;
top: -158px;
left: 50%;
width: 780px;
height: 317px;
visibility: visible
}
De esa manera deberá quedar centrado, realiza los cambios y me avisas.
__________________
►I'm a devil on the run ♂
Jcxnet.com
*Keep It Simple **
  #5 (permalink)  
Antiguo 28/09/2006, 09:05
Avatar de Laika  
Fecha de Ingreso: octubre-2001
Mensajes: 1.376
Antigüedad: 22 años, 6 meses
Puntos: 0
Ok ,

Muchas gracias, me ha servido mucho.
  #6 (permalink)  
Antiguo 13/10/2006, 04:03
 
Fecha de Ingreso: enero-2005
Mensajes: 5
Antigüedad: 19 años, 2 meses
Puntos: 0
hola a todos:

yo tengo un problema similar, pero siguiendo las instrucciones para Laika no he conseguido nada..

el codigo es este:

Cita:
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if
((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight;
onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH)
location.reload();
}
MM_reloadPage(true);
// -->
</script>
</head>

<body bgcolor="#FFFFFF" text="#000000">
<layer id="Layer1" left="96" top="74" width="200" height="115"
z-index="1"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase=enlace a macromedia width="779" height="517">
<param name=movie value="images/01home.swf">
<param name=quality value=high>
<embed src="images/01home.swf" quality=high
pluginspage=enlace del plugin type="application/x-shockwave-flash" width="779" height="517">
</embed>
</object></layer>

</body>
</html>
no necesito nada muy tecnico, solo que funcione...

gracias

saludos
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 16:11.