Divs in Divs

Giganews Newsgroups
Subject: Divs in Divs
Posted by:  Steffan A. Cline (steff…@hldns.com)
Date: Mon, 15 Sep 2008

I have a situation where I am making a calendaring solution and need to have
5 scrollable divs side by side in a week view but the week div needs to
scroll left and right. As it sits now, unless the week div is set to
something like 1500px, they wrap. The idea is not to have the browser scroll
left and right. Unfortunately this needs to work in IE6 also. =(

<div style="overflow:scroll; height: 500px; width: 700px;">
    <div style="float:left;">
        Monday<br>
        <div style="height:495px; width:300px; overflow:scroll>
            ...
        </div>
    </div>
    <div style="float:left;">
        Tuesday<br>
        <div style="height:495px; width:300px; overflow:scroll>
            ...
        </div>
    </div>
    <div style="float:left;">
        Wednesday<br>
        <div style="height:495px; width:300px; overflow:scroll>
            ...
        </div>
    </div>
    <div style="float:left;">
        Thursday<br>
        <div style="height:495px; width:300px; overflow:scroll>
            ...
        </div>
    </div>
    <div style="float:left;">
        Friday<br>
        <div style="height:495px; width:300px; overflow:scroll>
            ...
        </div>
    </div>
    <br style="clear:both">
</div>

Is there any way to have the height of the week div be automatically set to
the height of the days without specifying the height of the week div?

Also, inside the daily divs I have a vertical time line. Anyone know of an
easy way whether straight javascript or jQuery one might have say the 8:00
position be at the top of the scroll area (the day starts at 12AM)?

Any suggestions are MUCH appreciated.

Thanks

Steffan

Replies