PDA

View Full Version : DD Drop Down Panel + Absolute Positioning



dyzine
01-07-2009, 10:45 PM
1) Script Title:
DD Drop Down Panel

2) Script URL (on DD):
http://www.dynamicdrive.com/dynamicindex17/dddropdownpanel.htm

3) Describe problem:
my pages use pure css and absolute positioning, but it seems the drop down doesnt like this setup. the only way i can get this to work is by assigning an absolute position (top:0;) to the ddpanel div. this makes the panel appear on top of the header like it's suppose to, but when the panel is opened it overlaps the page rather than pushing it down. If I don't add the absolute positioning, then it will only push down the header, making the header overlap the rest of the page (which has a different absolute position). I dont mind the overlapping so much, but it would be really cool if the page could get pushed down like its suppose to. Is there any work around for this to be compatible with my setup and push down all elements even if they're absolutely positioned? many thanks :)

ddadmin
01-08-2009, 06:23 AM
Hmm I'm not sure you'll find the solution to this by changing the script. It has to come with certain modifications to your layout. There is no particular rules saying you can't put DD Drop Down Panel inside an absolutely positioned DIV, ie:


<div style="position:absolute; background: yellow">

//DD Panel entire HTML here

</div>

However, once you do that, expanding the panel no longer affects the height of the parent container (since it's absolutely positioned), and hence won't push down any content that follows this parent DIV. I'm sure there's a workaround, but as mentioned, I think it lies in tweaking your layout somehow.

dyzine
01-08-2009, 04:23 PM
yeah thats the problem i'm having. i have my content area and header area both positioned absolutely, and i need to keep it this way, but in order to have the drop down panel even visible above the header, it also needs to be absolutely positioned, but then it doesnt push down the page, it just overlaps everything. so i added a z-index of 999 to the ddpanel divs so it'll correctly overlap embeds too. so doesnt look like much can be done to make the ddpanel push the entire without removing the absolute positioning, but i'm okay with the overlapping, i'll just leave it like this. its a great script! I actually made the ddpanel's background a semi-transparent png which gives it a cool effect when overlapping everything else :D