JackNUMBER
Administrateur

Inscrit le: 25 Juin 2005
Messages: 700
Localisation: Paris
|
Posté le:
05 Avr 2011 20:23:55 |
  |
Encore plus légère que la version JavaScript.
Voici la version CSS-only pour fixer les PNG transparents avec Internet Explorer 6 :
Code: |
* html img,* html .png{
position:relative;
behavior: expression((this.runtimeStyle.behavior="none")&&(this.pngSet?this.pngSet=true:(this.nodeName == "IMG" && this.src.toLowerCase().indexOf('.png')>-1?(this.runtimeStyle.backgroundImage = "none",
this.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.src + "', sizingMethod='image')",
this.src = "images/spacer.gif"):(this.origBg = this.origBg? this.origBg :this.currentStyle.backgroundImage.toString().replace('url("','').replace('")',''),
this.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.origBg + "', sizingMethod='crop')",
this.runtimeStyle.backgroundImage = "none")),this.pngSet=true));
} |
Ajoutez seulement une image transparente spacer.gif dans votre dossier images
Fonctionne avec les PNG en arrière-plan.
Source
enjoy |
|
|