Jump to content

[SOLVED] dimming the background when div is visible


sayedsohail

Recommended Posts

Hi everyone,

 

I am not sure to open this thread here, please no grims.

 

I got a php page and a hidden div.  onlick of a button the hidden div is visible with zindex 100, but i would like to dim the parent window when the div is visible.

 

Can someone help in this regard.

 

Thanks,

 

you'll want to make a small, translucent image of some light-gray color.

 

then, make it the background of a hidden div with a width and height of 100% and a z-index somewhere between your main content and your pop-up.

 

when you un-hide the pop-up, unhide this div as well.

 

 

there may be other methods, but this is what i've done in the past.  Either way, you can't do this in PHP -- so mod's feel free to move this to another board.

Of course, IE6 does not support PNG, the only image file format which can make that sort of transparency. However, IE6 does support CSS transparency, IIRC. Google "lightbox" and you will see tons of pre made scripts to do what you want.

good point about the PNG

 

i remember now that most recently, i've used a 2 pixel gif where one pixel is a solid, light color (like #F3F3F3) and the other is completely transparent.

 

this grays out the background nicely and makes it more like a screen door

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.