Tussi
10-07-2004, 10:25 AM
Hi!
I have a problem. Not very good at javascript, but I've thought something out, which I think would work, if I only know how to do it...so:
I have a 800x600 swf file, and I would like to center it vertically and horizontal on the page. I've looked around, but it doesnt look possible to do, but since I know the size of it, wouldnt it be possible to calculate it sort of? I know you can position stuff anywere you want it with CSS, so if you found the height and width of the window, then you could calculate how far from the left and from the top the thing would have to be to be centered. Anyone following me? Is it possible? How would I do that? And would it be possible to keep it centered if the user resized the window after it was loaded?
I have a problem. Not very good at javascript, but I've thought something out, which I think would work, if I only know how to do it...so:
I have a 800x600 swf file, and I would like to center it vertically and horizontal on the page. I've looked around, but it doesnt look possible to do, but since I know the size of it, wouldnt it be possible to calculate it sort of? I know you can position stuff anywere you want it with CSS, so if you found the height and width of the window, then you could calculate how far from the left and from the top the thing would have to be to be centered. Anyone following me? Is it possible? How would I do that? And would it be possible to keep it centered if the user resized the window after it was loaded?