home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Join TechIMO for Free!
Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
Reply Get bargains at  »  Dealighted.com
 
Thread Tools
Currently Active Users: 1854
Discussions: 188,398, Posts: 2,243,595, Members: 232,629
Old December 7th, 2004, 06:42 PM   Digg it!   #1 (permalink)
Junior Member
 
Join Date: Dec 2004
Posts: 5
Question
Another .png problem, but with a twist

We've been dealing with images that have a high transparent to pixeled content. In everything but IE there doesn't seem to be a problem, but in IE - you can only click on the link if your mouse is over a pixel. A problem when dealing with footer images where transparency / resolution is key, but pixels are few and far between. Have you ran into any solution for this? Or must we wait (and continue waiting) on MS to pull their heads out of their ya-ya's?

webtechie is offline   Reply With Quote
Old December 7th, 2004, 07:23 PM     #2 (permalink)
Ultimate Member
 
Join Date: Jan 2003
Location: MA / NH
Posts: 1,497
Send a message via AIM to Blazer06
link?


Blaze

Blazer06 is offline   Reply With Quote
Old December 7th, 2004, 10:03 PM     #3 (permalink)
Junior Member
 
Join Date: Dec 2004
Posts: 5
Ahh, yeah sorry about not giving a 'working' example. Should be able to follow the link below and see what I mean.

http://www.phylo.com/png/footer.htm

I tried using a .gif either above (z-index) or below the .png's in order to fill the transparency, but neither idea worked - so ignore the extra callouts in the source. That's why they are there.


Last edited by webtechie : December 7th, 2004 at 10:05 PM.
webtechie is offline   Reply With Quote
Old December 7th, 2004, 10:07 PM     #4 (permalink)
Ultimate Member
 
paul9's Avatar
 
Join Date: Aug 2003
Location: Gateshead U.K.
Posts: 8,838
Send a message via MSN to paul9 Send a message via Yahoo to paul9
i'm fairly sure i saw outpatient state that ie has problems with png (i think it was specifically transparencies) in one of his posts. this sounds like that problem in action. i don't recall him posting a workaround though

Last edited by paul9 : December 7th, 2004 at 10:13 PM.
paul9 is offline   Reply With Quote
Old December 7th, 2004, 10:13 PM     #5 (permalink)
Ultimate Member
 
paul9's Avatar
 
Join Date: Aug 2003
Location: Gateshead U.K.
Posts: 8,838
Send a message via MSN to paul9 Send a message via Yahoo to paul9
i wasn't quite right, but here: http://www.techimo.com/forum/t128127.html
paul9 is offline   Reply With Quote
Old December 7th, 2004, 10:19 PM     #6 (permalink)
Junior Member
 
Join Date: Dec 2004
Posts: 5
Yeah, I've been able to implement the .png fix so that I don't get a solid grey where the transparency is suppose to be (even found a way to fix on the server side so sp2 can't disable the java) but now we're left with the linking problem. It's almost like the java (for IE) cuts all transparent pixels completely. I know nothing about Java (perhaps time to learn) so I don't know if there is a way to turn them truely transparent or not. Hope that makes sense. Not feeling all that great. Weeee... =/
webtechie is offline   Reply With Quote
Old December 7th, 2004, 10:34 PM     #7 (permalink)
ᅟᅠ
 
OuTpaTienT's Avatar
 
Join Date: Oct 2001
Location: ɐqɟs
Posts: 10,449
There is a workaround for the IE/PNG problem. You have include a small script in your html document then IE will display the transparency properly. Now I don't know if it'll also make the hotspots of the link correct like you want it to be...but all you can do is try it and find out.

Here is the script that needs to be in the <head> section of the document. You can either put all this text in each html document that needs it or you can put it in a seperate file and use css to call that file.

Code:
<!--[if gte IE 5.5000]>
<script language="JavaScript">
function correctPNG() // correctly handle PNG transparency in Win IE 5.5 or higher.
   {
   for(var i=0; i<document.images.length; i++)
      {
	  var img = document.images[i]
	  var imgName = img.src.toUpperCase()
	  if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
	     {
		 var imgID = (img.id) ? "id='" + img.id + "' " : ""
		 var imgClass = (img.className) ? "class='" + img.className + "' " : ""
		 var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
		 var imgStyle = "display:inline-block;" + img.style.cssText 
		 if (img.align == "left") imgStyle = "float:left;" + imgStyle
		 if (img.align == "right") imgStyle = "float:right;" + imgStyle
		 if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle		
		 var strNewHTML = "<span " + imgID + imgClass + imgTitle
		 + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
	     + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
		 + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
		 img.outerHTML = strNewHTML
		 i = i-1
	     }
      }
   }
window.attachEvent("onload", correctPNG);
</script>
<![endif]-->
An example of transparency working correctly can be seen here. Scroll the page and you should be able to see the background through the first of three banners.
OuTpaTienT is offline   Reply With Quote
Old December 8th, 2004, 02:35 AM     #8 (permalink)
Junior Member
 
Join Date: Dec 2004
Posts: 5
Yeah, the problem isn't getting IE to display the transparency - I've taken care of that with the linked javascript file www.phylo.com/png/javascript.js but with links in conjunction with .png's in IE. Following the footer.htm link above - you can see it in action. In IE if you cursor over a non-transparent pixel the background changes like it should, but any transparent pixels are basically non-existent.

The desired effect is basically to similate rollover images without the overhead of creating color specific images for each and every site. Change the color via the stylesheet and roll. Not proving as time saving as hoped for however.
webtechie is offline   Reply With Quote
Reply


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

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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
LZW compresion freeware now? Xtreeme Webmastering and Programming 9 November 19th, 2004 02:03 PM
Petition for no sigs. VHockey86 IMO Community 141 September 26th, 2004 12:53 AM
Benifits of PNG haxxorpoop Graphic Design and Digital Photography 30 September 5th, 2004 02:55 PM

Most Active Discussions
Is It Just Me? (2905)
Unarmed man on his stomach shot by .. (6)
Misery Loves Company... (2144)
New Build ( Finally ) (6)
CPU wont boot (7)
Building a gaming computer advice (5)
I think I just killed my computer w.. (24)
Folderchat Weekday thread (444)
Upgrading RAM (6)
Recent Discussions
Partition Magic 7.0 (Unallocate.. (17)
For cheap price and good qualit.. (1)
Left 4 Dead Small Freezes (3)
RCA 52Inch HDTV wont turn on (4)
wishin i could edit my aol prof.. (0)
Sporadic internet connectivity (2)
Assassins Creed PC Problems (40)
I think my PSU is dieing (1)
building a gaming computer, inp.. (0)
Blackberry Storm, Gears of War .. (1)
Core 2 Quad Q9550 system (3)
COWBOOM Ripoff! Used Laptop w/$.. (4)


All times are GMT -4. The time now is 03:30 AM.
TechIMO Copyright 2008 All Enthusiast, Inc.



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