Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DIV positioning problem

Status
Not open for further replies.

BobTB

Technical User
Oct 28, 2002
37
AU
Hi,

I have a page that has a table that is set to 100%. I then have placed a table inside and centered it and sized it at 760px. Inside the inner table I have placed the DIV for a scroller. The javascript for the scroller has the absolute coordinates for positioning the scroller DIV, and it is positioned correctly when the screen is maximised. The problem is that when the browser window is not maximised the scroller DIV stays at it's absolute coordinates but the rest of the web page moves when the window size is reduced. The actual web page with graphics centres ok when the browser window is reduced and the 100% outer table reduces in size. Is there a way for the scroller DIV container to move with the rest of the web page so it doesn't mess up the format of the page? Relative coordinates??? Here is the script with the absolute positioning...

<script language=&quot;javascript&quot; src=&quot;scripts/ScrollBox.js&quot;></script>
<script language=&quot;javascript&quot;>
var scroll = new ScrollBox(&quot;scroll1&quot;, 300, 125, 380, 200, 100)
</script>

Thanks
 
You could add an image to make the table not shrink below 760px. Make an image 1 pixel by 1 pixel the color of the pges background (so it will not be noticed) then add it like this:
<img src=&quot;spacer.gif&quot; style=&quot;width:760px;height:1px;&quot;>
It should probably go right inside the inner table. Make an extra <tr> for it at the beginning.

If this idea doesn't work, try sticking the scrolling div inside another div that's set to center.

Rick -----------------------------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top