[advanced search]
 

Go Back   NamePros.com > Discussion > Web Design & Development > Programming

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.


Closed Thread
 
LinkBack Thread Tools
Old 04-02-2004, 08:50 AM   #1 (permalink)
New Member
 
Join Date: Mar 2004
Posts: 9
16.00 NP$ (Donate)

Nevsan is an unknown quantity at this point


Loading different images depending on the browser (JavaScript)

I have an interesting problem... The way my page is designed, I use a lot of transparent images, so I use the .PNG format (Mostly to get dropshadows). Thing is, IE for Windows, doesn't seem to support the transparency so my sit ends up looking horrible. What I was wondering, is if it is possible to use a JavaScript or something to detect what browser is being used, and then load a different .GIF image (Without dropshadows)... I could just scrap the dropshadows in general but I would like to keep them for people with browsers that do support .PNG transparency...

Also, since my layout is completely CSS based (not a single table), I was wondering if I could to the same for background images, since a few browsers support .PNG transparency for background images too... (The url's of the background images are stored in the style sheet so I don't think JavaScript can help here, but it's worth asking.)

If you want to see what I mean when I say it renders horribly in Windows IE, take a look at this:

http://homepage.mac.com/nevsan/

It renders fine in Mac browsers though. I think Opera for Windows might render it correctly, so try that out to see what it's supposed to look like. Here's a screenshot of what it's supposed to look like.


P.S. While I'm here, any way to get rid of that 2 pixel spacing between div elements that ieWin seems to throw in there?
Nevsan is offline  
Old 04-03-2004, 04:52 PM   #2 (permalink)
NamePros Member
 
OneEyedDog's Avatar
 
Join Date: Mar 2004
Location: Middle Earth (NZ)
Posts: 162
104.00 NP$ (Donate)

OneEyedDog is on a distinguished road


Not so inline with PNG transparency but a technique I was looking at two days ago is here:

http://www.alistapart.com/articles/cssdropshadows/

Hope this helps in anyway,

Warm Wishes,
__________________
Script Installation, Avatars, Banners and Buttons for $NP or Paypal, PM me your requirements :D
Deni J Vanin | Freelance Jobs and Forums | Web Design
OneEyedDog is offline  
Old 04-03-2004, 06:26 PM   #3 (permalink)
NamePros Expert
 
Anthony's Avatar
 
Join Date: Dec 2003
Location: NYC
Posts: 9,201
26.71 NP$ (Donate)

Anthony has a brilliant futureAnthony has a brilliant futureAnthony has a brilliant futureAnthony has a brilliant futureAnthony has a brilliant futureAnthony has a brilliant futureAnthony has a brilliant futureAnthony has a brilliant futureAnthony has a brilliant futureAnthony has a brilliant futureAnthony has a brilliant future


I would recommend going with .gifs for transparency, since it doesn't look like IE will be supporting .png transparency anytime soon.
Anthony is offline  
Old 04-04-2004, 09:36 AM   #4 (permalink)
New Member
 
Join Date: Mar 2004
Posts: 9
16.00 NP$ (Donate)

Nevsan is an unknown quantity at this point


So I guess I'm SOL here? Damn. Those drop-shadows looked good too . Frickin' IE. I hate it. Funny how all hacks seem to target IE since it screws everything up, and yet it just happens to be the most popular browser. God I hate MS....

Oh, one more thought. Do you think it would be reasonable to, maybe, set up a PHP script or something so it loads different stylesheets/html pages depending on the browser or platform? I actually know nothing on PHP, but I already know C/C++ so it shouldn't be too hard.... Wait, would a webhost such as, say, .Mac, even let me use PHP?

Last edited by Nevsan; 04-04-2004 at 09:40 AM.
Nevsan is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Site Sponsors
Advertise your business at NamePros

All times are GMT -7. The time now is 10:13 PM.


Powered by: vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Template-Modifications by TMS
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85