-
swfobject.js centering
i'm using the swfobject.js script to embed my flash movie. works great. however, is there a way to center the movie horizontally, and not vertically? i would like the file aligned to the top.
i tried to search on the forums, but couldn't find it -- the wording is difficult. i am unfamiliar w/ js, so i'd be grateful for any help.
thanks!
jwt
-
Bearded (M|G)od
That has nothing to do with the swfobject. It's all about the containing <div> element. You can style that with any css you would like, for example positioning.
So you could simple add the style attribute: <div id="myflash" style="align:center">
-
Never knew of this attribute before
To center a div horizontally style ="margin:0 auto" This gives 0 margin at the top and bottom and auto makes the margins the same on the left and right. If your movie is 800px wide the margin would be the same for left and right of the remainder of the screen not used by the 800px.
-
thanks you guys for the options and clarification! i'll try it out.
thanks again,
jwt
-
Bearded (M|G)od
err, yeah, sorry about that, i meant: <div id="myflash" align="center">
There is no 'align' css attribute. Your margin method would work too.
Thanks for pointing that out.
-
it works, but...
thanks for your help again. it did work, HOWEVER...
in my flash movie, i disable scaling:
Stage.scaleMode = "noScale";
by doing so, it seems to override the align and the flash is centered vertically -- cutting off the top on a small browser. if i remove the noScale, it correctly aligns to the top.
i'd prefer to keep the noScale on, as it improves performance and quality of visit. if there is no solution i guess i'll have to make a hard choice. thanks again.
-
You may want to look into Stage.align if you haven't already...I can't see your page to see exactly what's happening, but it may help.
-
giddy-up.
well, rdoyle720, i did have that Stage.align script in my code -- but i did research as you advised and found that i had not put the proper syntax in it.
orig:
Stage.scaleMode = "noScale";
Stage.align = T;
final:
Stage.scaleMode = "noScale";
Stage.align = "T";
thanks everyone for helping me get a grasp on this. the site works properly now!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|