Discuti il tutorial sul forum !
Immagine PNG con effetto alpha
Internet Explorer does not support 24-bit PNG images with alpha transparency, as has been well documented around the Web (here are just a few: 1, 2, 3, 4). The crux of the "solution" to this problem is to use an Internet Explorer filter called AlphaImageLoader. AlphaImageLoader can be applied to a div element to display a PNG image properly using DirectX.
The difficult part of the problem is that AlphaImageLoader applies to div elements, whereas we need to use standard img elements on other browsers. Among other things, img elements size automatically when the image downloads, but div elements have to be sized explicitly with CSS.
Many of the solutions above are geared towards fixing static HTML. With Ajax apps, you generally construct HTML elements programmatically. This recipe is optimized for that approach:
function createPNGImage(src, width, height) {
if (navigator.userAgent.indexOf("MSIE") != -1) {
var element = document.createElement("div");
element.style.filter = "progid:DXImageTransform.Microsoft." +
"AlphaImageLoader(src=’" + src + "’)";
} else {
var element = document.createElement("img");
element.src = src;
}
element.style.width = width + "px";
element.style.height = height + "px";
return element;
}
The createPNGImage function returns a DOM element - a different node type depending on the user’s browser. Example usage:
var element = createPNGImage("example.png", 312, 33);
document.getElementById("output").appendChild(element);
Fonte: http://ajaxcookbook.org/png-alpha-transparency/
Correlati
- Effetto 3d con i css
- Applicare una immagine di sfondo ad un bottone con i css
- Creare un box con effetto shadow con i css
- Immagine con effetto shadow con i css
- Posizionare immagine a sinistra o a destra del testo con i css
- Caricare immagine jpg esterna in un movieclip
- Effetto opaco con i css
- Zoommare una immagine in javascript
- Effetto rollover con i css
- Effetto tooltip su un componente
- Effetto macchina da scrivere con actionscript
- Effetto tooltip con i css
- Scrivere email in una immagine per evitare gli spammers in php
- Come ritagliare e usare un immagine in photoshop
- mettere una immagine di sfondo ad una textarea
- Un box <div> con effetto fader
- Sostituire un filmato flash con un immagine se non si ha il plugin
- News con effetto fader
- Catturare il contenuto dello schermo in una immagine in java
- Creare effetto tooltip su un componte in java
- Scrivere del testo in una immagine con le librerie grafiche gd
- Cambiare l'immagine di sfondo di una pagina web in modo dinamico
- Dhtml Effetto rollover con javascript e i css
- Effetto tooltip su un componente in flash
- Crea il tuo effetto ajax
- Effetto acqua in photoshop
- Come estrarre una immagine con photoshop
- Immagine PNG con effetto alpha
- Hostingblog l'unico blog sull'hosting in italia
- Effetto Out of Bounds con photoshop
- Effetto vecchia foto in fireworks
- Imitare l'effetto scanner Darkly con ilustrator
- Creare un effetto 3d con photoshop
- Effetto drop shadow con i css
- Trasformare una immagine in vettoriale con illustrator
- Ridimensionare una immagine jpeg con php
- Ridimensionare una immagine con php
- Effetto acqua realistico con flash
- Effetto drop shadow con le librerie grafiche gd
- Effetto immagini glossy con javascript
- Effetto tooltip con flash
- Riflesso immagine
- Effetto innerfade con jquery
- Aggiungere effetto Glamour alle tue foto con photoshop
- Creare un effetto vecchio collage in photoshop
- Creare un effetto fumo con photoshop
- Creare una immagine con effetto polaroid con fireworks
- Effetto globo con photoshop
- Effetto camera di sorveglianza con photoshop
- Un tocco di colore in una immagine in bianco e nero
- Effetto neve su testo con photoshop
- 93 farfalle Vettoriali & Png Clipart Pack per photoshop
- Effetto neve su sito web con javascript - natale
- Crossfader script - ripoduce una sequenza di blocchi di codice html con effetto dissolvenza
- Effetto neve ancorata in Flash
- Le chiavi di ricerca più popolari del 2007 in Italia
- Effetto highlighting alle tue immagini con mapper.js
Commenti
Scrivi un commento














































