Forum Moderators: open

Message Too Old, No Replies

IE7 javascript "patch" -- Change alpha transparent PNGs SRC?

         

whoisgregg

2:15 pm on Aug 24, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This is a bit far afield, but I've already posted to the sourceforge project forum [sourceforge.net] with no response... :(

To support alpha transparency for PNGs in IE 6 I am using Dean Edward's IE7 javascript patch that adds that functionality. When the page loads, the script finds PNGs and replaces them with AlphaImageLoader calls if the browser is IE less than 7. It works fine, heck it works great.

Problem is, I have pages where the user can dynamically swap the SRC of the PNGs. Right now I reference the PNG using the it's ID. But, in IE6 using the IE7 javascript patch, that ID references an element that has been removed. I can't sort out how to reference the replaced object.

I have browsed through the source code but it's written in a way that does not make sense to me. Anyone have any ideas?

ctoz

11:51 pm on Aug 24, 2007 (gmt 0)

10+ Year Member



Maybe I'm missing something, but couldn't you just use jpegs or gifs and apply opacity via css, and then (at least for the functionality in question) you wouldn't need Dean's IE7? eg

.mygif {filter:alpha(opacity:70);opacity:0.7;-moz-opacity:0.7}

whoisgregg

6:34 pm on Aug 27, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The point of the alphaImageLoader filter is to apply the alpha transparency to the PNG in Internet Explorer. Not just opacity -- that's supported without any proprietary filters. A search for "png alpha transparency IE" in any search engine should bring up more information to illustrate the problem.

ctoz

12:05 pm on Aug 30, 2007 (gmt 0)

10+ Year Member



Sorry, been a while since I tried all that... rounded corners and semi-transparent backgrounds...

I doubt if this is helpful, but jus thinking: would there be a way of referencing the images by class instead of ID and then using multiple classes, one of which is unique to the replaced image another to the original image?