-
10 Nov 2010 7:13 AM #1
Transparent PNG icons IE6
Transparent PNG icons IE6
When I put a png icon is visible frame around it.

I tried to describe the icon in css
but it did not help.Code:.open { background-image:url(../images/icons/open.png) !important; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../images/icons/open.png', sizingMethod='scale'); }
Does anyone can suggest a solution?
-
11 Nov 2010 12:29 AM #2
-
11 Nov 2010 12:38 AM #3
Not if we can possibly avoid it.
IIRC, IE6 just cannot do this. It's ancient technology.Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
11 Nov 2010 1:15 AM #4
Here is a prototype example how to do transparent png in IE6, you should be able to convert it to ExtJS
PHP Code:Element.addMethods({
pngHack: function(element) {
element = $(element);
var transparentGifPath = 'clear.gif';
// If there is valid element, it is an image and the image file ends with png:
if (Object.isElement(element) && element.tagName === 'IMG' && element.src.endsWith('.png')) {
var alphaImgSrc = element.src;
var sizingMethod = 'scale';
element.src = transparentGifPath;
}
if (alphaImgSrc) {
element.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="#{alphaImgSrc}",sizingMethod="#{sizingMethod}")'.interpolate(
{
alphaImgSrc: alphaImgSrc,
sizingMethod: sizingMethod
});
}
return element;
}
});
Event.observe(window, 'load', function() {
if (Prototype.Browser.IE) {
var version = parseFloat(navigator.appVersion.split(';')[1].strip().split(' ')[1]);
if (version === 6) {
$$('img').each(function(img) {
img.pngHack();
});
}
}
});
vg Steffen
--------------------------------------
Release Manager of TYPO3 4.5
energlobe.de - german online magazine
-
11 Nov 2010 3:40 AM #5
-
27 Apr 2012 7:46 AM #6Ext JS Premium Member
- Join Date
- Jan 2010
- Location
- Rotterdam, The Netherlands
- Posts
- 383
- Vote Rating
- 8
I have converted it for Ext JS.
Code:if (Ext.isIE6) { Ext.select('img').each(function(element) { var endsWith=function(s) { return this.indexOf(s, this.length - s.length) !== -1; }, alphaImgSrc, urlMatch; if (endsWith.call(element.dom.src, '.png')) { alphaImgSrc = element.dom.src; element.dom.src = '/images/s.gif'; element.setStyle('filter', 'progid:DXImageTransform.Microsoft.AlphaImageLoader('+ 'src="'+alphaImgSrc+'",sizingMethod="scale")'); } else if (urlMatch=element.getStyle('background-image').match(/^url[("']+(.*\.png)[)"']+$/i)) { alphaImgSrc = urlMatch[1]; element.setStyle('background-image', 'none'); element.setStyle('filter', 'progid:DXImageTransform.Microsoft.AlphaImageLoader('+ 'src="'+alphaImgSrc+'",sizingMethod="crop")'); } }); }
Similar Threads
-
[3.0/core] IE6 PNG fix
By dj in forum Ext 3.x: User Extensions and PluginsReplies: 3Last Post: 10 Nov 2010, 9:38 AM -
IE7 Png transparent slideIn+FadeIn or slideOut+FadeOut
By moochkai in forum Ext 2.x: Help & DiscussionReplies: 0Last Post: 18 Dec 2008, 2:21 AM -
The best way to get 24-bits PNG images as buttons in IE6?
By bartvde in forum Ext 2.x: Help & DiscussionReplies: 1Last Post: 20 Feb 2008, 7:10 AM -
How does one save a PNG with a transparent body?
By jay@moduscreate.com in forum Community DiscussionReplies: 3Last Post: 15 Oct 2007, 9:30 AM -
slightly OT, is IE7 still buggy with transparent png's ?
By neongrau in forum Ext 1.x: Help & DiscussionReplies: 3Last Post: 15 Mar 2007, 8:25 AM


Reply With Quote