jquery-ui-dialog uses an overlay div for modal dialogs. The div has this style:
.ui-widget-overlay {
background: #AAA url(images/ui-bg_flat_75_aaaaaa_40x100.png) 50% 50% repeat-x
opacity: 0.3;
}
Why does it specify both background color and image? Why not just a color?
I think it is safer to always apply a color along with the background image.
The browser could not support png format, or the request for the image could fail (for whatever reason).
The color on the other hand will always be applied. See it as a sort of backup plan :-)
Edit:
You actually do not require an image file to simply create a colored semi-transparent overlay. Just background-color
and opacity
are sufficient.
I think the exact reason is that jquery ui allows applying textures (you can choose them or disable them in the ThemeBuilder app on the jquery ui website. This is why the image is used, even when no texture is selected. No texture is actually the "flat" texture. You can actually see it in the name of the image file:
ui-bg_flat_75_aaaaaa_40x100.png
If you apply the "white-lines" texture to the overlay in the ThemeBuilder, it will generated image files with this name:
ui-bg_white-lines_75_aaaaaa_40x100
The first part of the answer is still valid but this is more the main reason in the case jquery ui.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With