PDA

View Full Version : open index.html centered in window



henrikson
07-19-2005, 06:05 PM
I have searched the web what seems from top to bottom and can not find an answer to my question. I would like to create a web page that when opened is centered (that is, the horizontal scroll bar is in the middle). I have in mind to create a series of images side by side by turning my camera in a 360 degree rotation. In essence, I'm creating a poor man's panoramic view. The total width of the images (side by side) could be quite wide. I want the page to load in the center so that one would be looking directly into the room and by scrolling left or right one would get the appearance of turning around.

I have found lots of stuff about opening a new pop-up window which is not what I want. I want the main window centered.

I'm a relative novice so specific directions would be appreciated. I would like the solution to work on IE, Mozilla and Netscape (other browsers are a bonus). I'm not sure it it can be done but it seems to me it could.

Thanks

jscheuer1
07-19-2005, 07:10 PM
Well, this should be pretty easy. I am assuming that you know the total pixel width of the page or can estimate it my adding together the pixel widths of all the images. With this number in hand, add this to your body tag so it looks like this (plus whatever was in there already):

<body onload="window.scrollTo(x,0);">where the red x is about one half of this number. Let's say one half of the number is 1600. Don't use 1600px, just use 1600. If that doesn't get you to the exact center, try increasing or decreasing the value until you get it like you want.

henrikson
07-19-2005, 07:22 PM
I don't know the exact width yet as I haven't created the page, but your input I'm sure will help. Now that I know what to do, I can start.

Thanks,

Steve

jscheuer1
07-19-2005, 07:31 PM
I've done a little experimenting and it is more like one half. Also, to line up the images like that and not have them wrap will require the <nobr> tag, like:

<nobr><img src="1st.jpg"><img src="2nd.jpg"><img src="3rd.jpg"></nobr>

sportious
07-23-2005, 02:11 PM
I've done a little experimenting and it is more like one half. Also, to line up the images like that and not have them wrap will require the <nobr> tag, like:

<nobr><img src="1st.jpg"><img src="2nd.jpg"><img src="3rd.jpg"></nobr>


do you have a demo page to your experiment??? I am curious to see.

JL

IanMarlowe
07-23-2005, 02:14 PM
<nobr><img src="1st.jpg"><img src="2nd.jpg"><img src="3rd.jpg"></nobr>

<nobre></nobre>

what does that mean?

sportious
07-23-2005, 02:16 PM
<nobre></nobre>

what does that mean?


it means no break (nobr).

IanMarlowe
07-23-2005, 02:19 PM
aha................sounds like dutch.