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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script Problem . . Screen Resize problem with DIV

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 a DIV for a scroller. The javascript for the scroller has the absolute coordinates for positioning the scroller DIV, and it centres ok when the screen is maximised. The problem is that when the browser window is not maximised the scroller DIV stays at it's 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?

Thanks
 
Can someone please help with this problem.....it is now getting urgent.......thanks
 
Can't you just center the div instead of setting its position absolutely? If not, please post a url.

Rick
-----------------------------------------------------------
 
Hi RISTMO,

If I do that, do I then need to remove the absolute cordinates in the javascript, as shown below

<script language=&quot;javascript&quot; type=&quot;text/javascript&quot;>
var scroll = new ScrollBox(&quot;scroller&quot;, 300, 120, 380, 200, 100)
</script>
 
Try and see, but it might (probably will) mess things up. I would need to see the full code to find a fix if that messes it up.

Rick
-----------------------------------------------------------
 
Correct me if I'm wrong, but shouldn't you be able to use relative coordinates? You can make the coordinates for the scroller DIV relative to the coordinates of the larger DIV. This way, when the larger DIV resizes with the page, the scroller will automatically adjust. I'm sure one of the designers on here can tell me if I'm close. If not, you may want to drop this question into the HTML forum.
 
Hi,

To make the coordinates Relative to the larger DIV do I need to add anything to the code, apart from just changing the coordinates????
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top