View Full Version : Centering an oversize swf in browser
leroy
06-27-2007, 02:34 AM
Hey there,
I wanted to know if it is possible to center and oversized swf (say 2000px or wider) that is embeded into html, so that the left and right edges of the swf go beyond the browser window?
Not sure how it's been done, but this site (http://www.deepend.com.au) is the effect I am after. As you can see the flash remains completley centered regardless of browser size and appears to go beyond the window.
Hope that makes sense! Any help would be greatly appreciated...
_Aerospace_Eng_
06-27-2007, 02:42 AM
Give us the exact size of the swf.
leroy
06-27-2007, 03:06 AM
Looking at 2000(px) wide x 600 high..
leroy
06-27-2007, 03:43 AM
Give us the exact size of the swf.
Looking at 2000(px) wide x 600 high..
_Aerospace_Eng_
06-27-2007, 08:04 AM
Give this a try.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
<style type="text/css">
html, body {
height:100%;
}
#theflash {
position:absolute;
left:50%;
bottom:50%;
margin-left:-1000px;
margin-bottom:-300px;
}
</style>
</head>
<body>
<object type="application/x-shockwave-flash" data="flash.swf" width="2000" height="600" id="theflash">
<param name="movie" value="flash.swf">
</object>
</body>
</html>
leroy
06-28-2007, 12:50 AM
Give this a try.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
<style type="text/css">
html, body {
height:100%;
}
#theflash {
position:absolute;
left:50%;
bottom:50%;
margin-left:-1000px;
margin-bottom:-300px;
}
</style>
</head>
<body>
<object type="application/x-shockwave-flash" data="flash.swf" width="2000" height="600" id="theflash">
<param name="movie" value="flash.swf">
</object>
</body>
</html>
Thanks _A_E_, that seems to have worked!
It doesent seem to work in IE for some reason though. Could it be to do with the html?
Appreciate your help with this.
_Aerospace_Eng_
06-28-2007, 03:13 AM
Try this instead
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
<style type="text/css">
html, body {
height:100%;
}
#theflash {
position:absolute;
display:block;
left:50%;
top:50%;
margin-left:-1000px;
margin-top:-300px;
}
</style>
</head>
<body>
<object type="application/x-shockwave-flash" data="flash.swf" width="2000" height="600" id="theflash">
<param name="movie" value="flash.swf">
</object>
</body>
</html>
leroy
06-28-2007, 03:33 AM
Thanks again, but IE still doesnt like it. I'll mess around with it for a while to see if i can sort it out.
Thanks again for your help...
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.