Transparent png's

  • Thread starter Jafar As-Sadiq Calley
  • Start date
J

Jafar As-Sadiq Calley

Hi all. I've just done a hand coded remake of my moonlife-records.com site
(with bgsound hehe) and I have extensively used transparent png's because
the gif versions of the graphics sucked big time.
Am I being selfish by making life difficult for the IE crowd? IE is the
only browser that doesn't render transparent png's and trying to please
the 30% of my viewers who are IE users is just holding me back from what I
want to do with my site.
I sticking a "Go Firefox" button on your site and moving forward the right
thing to do?
 
M

Morgan

Just use a little javascript to give the IE crowd gifs and the others
pngs.

This script would put either an gif image or a png image depending on
the results of the code.
(put this into your html code)

<script type="text/javascript">
<!--
if( navigator.appName=="Microsoft Internet Explorer")
{
document.write("<img src='directory/image.gif' />"); //put gif
location here
}
else
{
document.write("<img src='directory/image.png' />");// put png location
here
}
//-->
</script>

This is only an general example of what could be done, but its
certainly not crossbrowser as it should be.
I'll leave it to the others to make more sophisicated examples.
 
M

Michael Fesser

..oO(Morgan)
Just use a little javascript to give the IE crowd gifs and the others
pngs.

Why not use server-side content negotiation instead?

Micha
 
T

Toby Inkster

Morgan said:
<script type="text/javascript">
<!--
if( navigator.appName=="Microsoft Internet Explorer")
{
document.write("<img src='directory/image.gif' />"); //put gif
location here
}
else
{
document.write("<img src='directory/image.png' />");// put png location
here
}
//-->
</script>

And anyone with a non-Javascript browser gets diddly-squat.

Better:

<img id="myimg1" src="flibble.png" alt="Flibble">
<!--[if IE]>
<script type="text/javascript">
document.getElementById('myimg1').src='flibble.gif';
</script>
<![endif]-->
 
L

Leif K-Brooks

Jafar said:
Am I being selfish by making life difficult for the IE crowd? IE is the
only browser that doesn't render transparent png's and trying to please
the 30% of my viewers who are IE users is just holding me back from what I
want to do with my site.

You could use a script like the one at
<http://homepage.ntlworld.com/bobosola/> to make translucent PNGs work
in IE.
 
J

Jafar As-Sadiq Calley

Just use a little javascript to give the IE crowd gifs and the others
pngs.

Thanks but the 1bit gif transparency sux ;) But I'll keep your little code
snippet as I'm learning js now. cheers.
 
P

Paul Watt

Jafar As-Sadiq Calley said:
Absolutely brilliant! I've been looking for something like this for ages!
:)
Thanks.

Why are you so against IE users? The whole point of the internet is the
exchange of information, without prejudice or browser snobbery. Roughly 86%
of internet users use IE in one flavour or another, why would you want to
alienate them? The goal of web design is to make your page display exactly
the same on the end users computer regardless of browser or computer set up.

Paul
 
S

Spartanicus

Paul Watt said:
Why are you so against IE users?

I haven't checked out what Jafar is doing, but there's nothing against
having a web site that works for IE users whilst providing some cosmetic
enhancements for users of more advanced browsers.
The whole point of the internet is the
exchange of information, without prejudice or browser snobbery.
Indeed.

The goal of web design is to make your page display exactly
the same on the end users computer regardless of browser or computer set up.

Crickey no, that's dead tree edition thinking. Fortunately the web
allows a lot more flexibility, don't fight that, it's a strength.
 
P

Paul Watt

Spartanicus said:
I haven't checked out what Jafar is doing, but there's nothing against
having a web site that works for IE users whilst providing some cosmetic
enhancements for users of more advanced browsers.


Crickey no, that's dead tree edition thinking. Fortunately the web
allows a lot more flexibility, don't fight that, it's a strength.
You dont belive that a web page should look the same on a PC screen as it
does on a PDA screen or on a Mac using Safari?
 
T

Travis Newbury

Paul said:
You dont belive that a web page should look the same on a PC screen as it
does on a PDA screen or on a Mac using Safari?

That completely depends on what you think the web can be used for. In
its purest form, every page should be functional regardless of who or
how you view it.

In reality it something that has many nooks and crannies. And not all
of them are (or need to be) usable by everyone.

YMMV
 
A

Alan J. Flavell

You dont belive that a web page should look the same on a PC screen

"believe"? That's a strong concept. Try alt.religion...?

I don't see any reason that a web page should look the same on a PC screen
as it does on another PC screen. Or even the same one under different
conditions. Flexible design can adapt to the display situation, of which
there are many possibilities even in that particular corner of reality.
as it does on a PDA screen or on a Mac using Safari?

Even more so.

Embrace flexible design. Exploit it. Stop aiming at fragile designs
based on inappropriate brochureware concepts tied to a fixed paper size.
 
S

Spartanicus

Paul Watt said:
You dont belive that a web page should look the same on a PC screen as it
does on a PDA screen or on a Mac using Safari?

I know that it isn't possible. Users use different viewport sizes, they
may override things like author font suggestions, colours, they may have
tables disabled, they may have graphics disabled, javascript, they may
render web pages on a non graphical platform. That's just a sample of
things that will make any web page look very different on different
client systems.

Properly coded websites will work under all those conditions. Web sites
that have been coded in an attempt to "look the same" often break
horribly under varying conditions.
 
D

dorayme

From: "Alan J. Flavell said:
"believe"? That's a strong concept. Try alt.religion...?

It is certainly a badly understood one. And the folk who most
misunderstand it are to be found congregating around religion.
I don't see any reason that a web page should look the same on a PC screen
as it does on another PC screen. Or even the same one under different
conditions. Flexible design can adapt to the display situation, of which
there are many possibilities even in that particular corner of reality.

But on this, Alan, you are undoubtedly right...

dorayme
 
J

Jafar As-Sadiq Calley

Wow. What a huge discussion I sparked off :)
Anyway, I have implemented the IE fix via javascript from Leif's link and
added some mouseovers too.
Now it works with all browsers again! (as long as the IE user has js
enabled) :)
As for browser percentage, IE only has about 30% on my server. Firefox is
the dominant browser so far this month. Good to see.
 
D

Dirk

Jafar said:
Hi all. I've just done a hand coded remake of my moonlife-records.com site
(with bgsound hehe) and I have extensively used transparent png's because
the gif versions of the graphics sucked big time.
Am I being selfish by making life difficult for the IE crowd? IE is the
only browser that doesn't render transparent png's and trying to please
the 30% of my viewers who are IE users is just holding me back from what I
want to do with my site.
I sticking a "Go Firefox" button on your site and moving forward the right
thing to do?

IE only makes problems with 24bit transparent png's. Reduce the number
of colors to 256 (8bit) and the png's will work in IE.

Dirk
 
J

Jafar As-Sadiq Calley

IE only makes problems with 24bit transparent png's. Reduce the number
of colors to 256 (8bit) and the png's will work in IE.

That doesn't look as nice though. I think I'll stick with the javascript
fix and use a <noscript> tag to ask those with it disabled to enable it or
upgrade their browser. :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top