Can somebody help me to overlay a div in a jQuery dialog? In my case the image (ajax loading) should be centered horizontally and vertically in the div. It also shouldn’t be affected by the div-opacity.
Have a look at my jsfiddle
http://jsfiddle.net/zhw8B/
I’m really not a CSS expert. 🙁
Thank you very much for your efforts
Kind regards
shub01
To have your overlay not be affected by the opacity of
#div1, it cannot be placed inside#div1. You’ll need to use a container:Of course it is the container that you’ll be opening in a dialog:
You’ll need to split your CSS into two selectors. Since
.overlayis nothing but aDIV, you’ll need to assign it a height.Finally, to center the overlay, set it to
left: 50%(which will make it start after 50% of the container), and adjust it to minus half its size, to get the center of the overlay, rather than its left corner to be at the center. Then repeat for height:Working example