Click to See Complete Forum and Search --> : Setting DIV's to scroll


marko_one
07-03-2003, 10:58 AM
Hi All,
Not sure if this is a javascript question, but i know it will involve writing a javascript function - so here goes.

I need to develop a page which gets data from a database, this will be from 2 different tables in the database. This data will be displayed in the page as 2 lists in the page. Now is the hard part:

What I need is to be able to have the list rendered dynaically on the screen such that if the 2 lists' total vertical size is bigger than the browsers window then the lists will scroll on the page. If both lists are big, then the DIV's containing the lists will both take 50% of the available space. If one list is big and the other list has only a couple of items in it then the small list will display without scrolls and the large list will fill the rest of the visble area with scrolling. The other situation is if the lists are both small then I just want them to display next to each other normally.

I have been given some advice that I should use a spacer.gif size=1 at the boundaries of each div (that is 4 spacers) and then use some function to get the spacing between the spacers as the page is rendered to the screen and then run the function to resize the screen

Any Ideas how to do this one?

thanks

Marko

Khalid Ali
07-03-2003, 11:01 AM
set the heights of the divs to whatever and use stylesheets

overflow:auto;

marko_one
07-03-2003, 11:05 AM
Thanks for the reply Khalid, but I havent got a clue how to start this one - i think i need much more help than this.

marko_one
07-03-2003, 11:08 AM
I Need to be able to detect how big the window is, not just resolution, if the open a window half height/width, then I need to be able to detect this and render to suit etc - I don't know how to do this in javascript.