OZONE Asylum
Forums
XML - XSL - XSLT - XHTML - CSS - DOM
Vertical Centering
This page's ID:
10669
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
Verticle centering with Javascript isn't slow at all. Not if it's done right. The link to bugs' script that MissTerry posted works well. Althought that won't work in Opera as it doesnt support the onResize() method. There is a way around this however the explanation is a little lengthy and best left to the DHTML/Javascript forum. As for the images loading before the JS will center it.... Well I don't think there's a way around that. I was doing a similar thing once and encountered the same problem. I ended up putting in a preloader to cover it as nothing else I tried worked. However, once it's loaded and for non image elements it's lighting fast. Sadly you can't even fake it with relative margin or padding values as theise % values are relative to the width of the page regardless of the value like so: [b]If we are given a page at this size:[/b] Page Height = 200px Page Width = 500px [b]The following:[/b] margin-top: 10%; margin-left: 10% [b]Would actually be:[/b] margin-top: 50px; margin-left: 50px Not 20px & 50px as one would expect. Which is just outright poo if you ask me. [url=http://www.dracusis.f2s.com] [img]http://www.whatever.net.au/~cameron/ozone/sig-dogtags-small2.gif[/img] [/url]
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »