I am very new to Javascript... More of a php kinda guy. However I have a question regarding the old explorer browsers. I'm using transparent pngs on my site that rollover when the mouse hovers over them. Obviously the pngs are not looking so hot in the old explorer but looks awesome in chrome, safari, etc.

Option 1

Add Java script or Css to somehow allow old explorer to see the pngs correctly.

Option 2

if option 1 becomes to complicated ask the borrower to upgrade their browser by detecting

Does anybody have a good snippet of code for both options?

Recommended Answers

All 2 Replies

I am very new to Javascript...

That would definitely explain why you wrongly posted JavaScript question in Java Server Pages (JSP)

Post moved!

Razor,

No amount of javascript or CSS can force a browser to display png images if it is not equipped to do so.

The simplest solution is to use gif images instead. Gifs support animation and transparency but not partial transparency.

If you want to give users of modern browsers the extra benefits of png whilst still providing limited support to older browsers, then you could try a "graceful degradation" approach. In this, failure to load a png would result in a second attempt to load a gif, and would require scripting in javascript, Success of this approach depends on whether the Image.onerror event fires on png failure in older browsers. I expect it does but have not tried it.

Airshow

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.