Hello. I have three DIVs that are stacked vertically. Each section (div) I want to be able to 'collapse' or minimize, and when that happens, for instance when the first div is 'minimized' the second two divs shift their left/top positions to fill the space. Right now, I'm doing this automatically, by creating a javascript function and changing the top/left and "height" properties manually.
Is there a better way to do this? there has to be...
dep
liorean
12-14-2005, 05:04 PM
There are ways of getting the browser to do this for you, but what works depends a bit on your code. Are the divs relatively or absolutely positioned? Are they floated or not? Are they direct siblings?
There are ways of getting the browser to do this for you, but what works depends a bit on your code. Are the divs relatively or absolutely positioned? Are they floated or not? Are they direct siblings?
I was thinking that they should be left floated sibling DIVs of one single parent containing the three sibling divs... Positioned relatively. Is that the best way?
dep
liorean
12-14-2005, 06:45 PM
It sounds like a good solution. Now, how exactly are you "minimising" them?
It sounds like a good solution. Now, how exactly are you "minimising" them?
Well, right now, I'm passing the div ID to a function that modifies the 'style.height' of the div, which resizes the DIV, but doesn't do much on repositioning/resizing the other divs.
liorean
12-14-2005, 08:32 PM
Not sure exactly how you want this done, but here's a proof of concept of how to do it using changes to the element's classes, letting the browser automatically position and redraw things.
<uri:http://liorean.net/help/dep/>
Not sure exactly how you want this done, but here's a proof of concept of how to do it using changes to the element's classes, letting the browser automatically position and redraw things.
<uri:http://liorean.net/help/dep/>
i will check it out. Thank you!
Not sure exactly how you want this done, but here's a proof of concept of how to do it using changes to the element's classes, letting the browser automatically position and redraw things.
<uri:http://liorean.net/help/dep/>
This is handy, but in each DIV is a big table to position the elements. I need to modify the script section that calls 'firstChild,' but don't really know how :)