Solved

PNG for every browser EXCEPT MSIE

Posted on 2006-07-09
3
197 Views
Last Modified: 2008-03-17
Hello.

I have two versions of the image 'balloon.png'.

The .PNG looks better but it does not work properly on MSIE because it has an alpha-transparency.

So I want to serve the UGLY .GIF to MSIE users but the .PNG to everyone else.

Right now I use this to display the PNG version:
                    document.writeln("<img src='balloon.png' onmouseover='fix(\""+j+"\");'>");


I need something like this, but my syntax is off...

                    if (browser==MSIE) imgExt=".gif" else imgExt=".png"
                    document.writeln("<img src='balloon."+imgExt+"' onmouseover='fix(\""+j+"\");'>");


Any ideas  how?

Thanks!

0
Comment
Question by:hankknight
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 16

Accepted Solution

by:
sam85281 earned 500 total points
ID: 17068944
if (navigator.appName == 'Microsoft Internet Explorer') {
// do this
} else {
//do this
}

-Sam
0
 
LVL 16

Expert Comment

by:sam85281
ID: 17068956
By the way, you CAN use a PNG in IE with a little simple scripting.

This tells all:

http://homepage.ntlworld.com/bobosola/

-Sam
0
 
LVL 16

Author Comment

by:hankknight
ID: 17069238
Thanks!

I accepted you first comment as the answer because it directly answers my question, but I will be using the IE PNG fix as a solution.
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

626 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question