I have a DIV with a transparent PNG background applied to it. Is there a way (use of JS is fine) for me to:
- Have the transparency effect when images are enabled
- Apply a normal solid background color to it when images are disabled
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
As I remember, if you set background-color and background-image, that would not work with transparent PNGs (over the transparency you will see background-color).
Te solution is to use a special css class:
Then make a script:
DIV#trans_png is used to check if image is loaded, you can do it in way you like, I prefer simplest without scripting.