JOIN DEVPPL

It looks like you are new here. If you want to get involved, click on Join below!



Side by side DIV tags - dynamically changing


K

keyboard_arrow_up
0
keyboard_arrow_down


First Post Mark as Spam kdjuiopo
Posts: 90 - Registered: 2011-06-30 20:32:13

I have side by side div tags - each container is 300px wide. Sometimes both containers are filled - other times only the left container - this happens dynamically and i don't have control of this.

So, I would like to have the left container center itself with the 600px area when the right container is empty. Any ideas?

I have tried changing the floats, but cannot seem to get it to work. Thanks in advance for your ideas...




R

keyboard_arrow_up
0
keyboard_arrow_down


Reply #1 Mark as Spam rajmv
Posts: 103 - Registered: 2011-07-14 02:22:09

Yes, you call a javascript function after you update the content of your content divs.
This could be in <body onload="checkContent()">.

That js checks if the right div is empty, and adjusts the left div's .style.left if the right div is empty (rightdiv.innerHTML=='').






JOIN DEVPPL

It looks like you are new here. If you want to get involved, click on Join below!




MENU
Advertising