Click to See Complete Forum and Search --> : Xpos and Ypos - is there a positioning alternative?


RTR
10-16-2003, 10:24 AM
Hi,

When using the
Xpos= n;
Ypos= n;
code to position an event (sorry if event is the wrong word), when screen resolution changes the 'event' isn't in the same position (naturally when using pixel positioning).

Question is: how can I position this thing to stay where it is on the screen at different resolutions?
Here's a link to an example page so you can view it if you like.....


TEXT FADE (http://home.earthlink.net/~rtrstudio/tfs.htm)

It's set up for 800 X 600 res, so start there if you are checking it out. Then change your screen res to 1024 X 768.
You'll see what I mean.

Does <!-- STEP THREE:---> in the code have anything to do with it?
Sorry for my ignorance. I have been using javascript for a year now (very basic) and am trying to learn more.

Thank you so much for any help. This forum is amazing!

-RAY

krautinator
10-16-2003, 11:58 AM
yes , step three has everything to do w/ it

do your self a favor and never use style="postion:ABSOLUTE top:0 left:0"
instead use style="postion:RELATIVE top:0 left:0"

krautinator
10-16-2003, 12:00 PM
by the way, top:0 and left:0 are like x and y coordinates for the page, just in case you didn't know

RTR
10-16-2003, 08:12 PM
Thanks for the response krautinator. However it did not solve my original problem. It seems to have created another.

Here's before and after adding your 'fix'....

BEFORE (http://home.earthlink.net/~rtrstudio/tfs.htm) and AFTER (http://home.earthlink.net/~rtrstudio/tfsAfter.htm)

Did I do it right? It's definitely not behaving.

Here's some screen shots of the code before and after the change...

Code Before (http://home.earthlink.net/~rtrstudio/before.jpg) and Code After (http://home.earthlink.net/~rtrstudio/after.jpg)

And here's a shot of the Xpos and Ypos settings that I started with to position the event originally. After I insert your 'fix', it doesn't matter what I change these numbers to. Nothing changes.....

Xpos and Ypos (http://home.earthlink.net/~rtrstudio/dm.jpg)

After your 'fix', it doesn't matter what I set these two numbers to. Nothing changes. Do I have to make some kind of change in the Xpos and Ypos settings. Again changing these does nothing after your 'fix' is in.

I merely want (if possible) a way to position this event in the center of the screen. Then as you change screen resolution, the event would keep itself in the center of the screen, unlike its present behavior.

Thanks for any further help with this minor but irritating problem.

-RAY

stepheno
10-16-2003, 09:08 PM
Try this:
<body>
<table width="100%" height="100%">
<tr>
<td height="33%">
</td>
</tr>
<tr>
<td height="33%" align="center">
text goes here
</td>
</tr>
<tr>
<td height="33%">
</td>
</tr>
</table>
</body>


Just replace the "text goes here with the code to display your fading text.

krautinator
10-17-2003, 10:15 AM
yeah it would create problems if you change the position relative inside the style tag, because you've already set that up in your code
example:

style="position: relative;"
you originally had:
style="position: absolute;"

sorry i confused you w/ the top:0 and left:0
you would use that if you haven't already set up your position coordinates in the javascript code

RTR
10-17-2003, 11:54 PM
Stepheno:
Thank you. That nailed it down. I didn't think of html tables and rows etc. I get so caught up in the js that I forget about the fundamentals. Thanks again.

Krautinator:
Thank you. I finally got it all working. Your code together with Stepheno's fixed it up nice. I had to redo a lot of the content on the finish page. What you guys saw were just stripped down pages just showing the problems. It was an interesting challenge and I'm happy to say successful, (without the loss of too much hair <g>) thanks to my skilled new friends here.

Thank you for your generous spirits.

-RAY

stepheno
10-18-2003, 01:12 PM
and glad you got it working.