...

View Full Version : Need help with displaying image depending on browser



shaitiger
03-12-2009, 03:29 PM
Does anyone here know of the javascript I'd use in a situation where I didn't want to display a certain image when the client is using IE6? I'm fine with displaying it in IE7 and Firefox, but don't want it displayed in IE6. Any help would be much appreciated. The image is a PNG with a transparent background. thanks!!

freedom_razor
03-12-2009, 03:41 PM
You can use IE conditional comments:


<!--[if !lte IE 6]> <your img tag> <![endif]-->

shaitiger
03-12-2009, 03:52 PM
I used that code and now I can't see it in Firefox but I can see it in IE7. I haven't tested it in IE6 yet but I need it show up in Firefox as well as IE7. Thanks

freedom_razor
03-12-2009, 04:06 PM
<!--[if !lte IE 6]><!--> your IMG here <!--<![endif]-->

shaitiger
03-12-2009, 07:54 PM
Thanks for that. It worked. What about if I wanted to replace the image with another one for IE6? Thanks!!

freedom_razor
03-12-2009, 08:08 PM
That should show the image only in IE6 and lower:

<!--[if lte IE 6]> <your img tag> <![endif]-->



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum