fixPng Jquery Plugin ie6
Download & Demo
Demo: http://blog.idealmind.com.br/exemplos/fixpng/
Download: http://blog.idealmind.com.br/exemplos/fixpng/fixpng.rar
ENGLISH
This plugin solves the problems of transparency in PNG in Internet Explorer 6.
It looks for all the images and puts them in the background with an opacity filter, replacing the original image with a transparent 1px gif.
Using
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/fixpng.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("body").fixPng();
});
</script>
The code to put images not changes:
<img src="img/image.png" alt="png image" />
Options
$("body").fixPng( [ string gif_file, string attr, string noreplace ] );
gif_file – If you use a file different then “img/vazio.gif”, use this option to set the correct path to a transparent gif.
attr – If you do not want to apply the filter on a specific image, use this option to set the attribute of the image that will not have the filter. The default is the attribute ‘rel’.
noreplace – The attribute value defined above. The default is ‘noreplace’.
Example
$("body").fixPng( "images/null.gif", "class", "nofixpng" );
Image that will not filter
<img src="img/imagem.png" class="test nofixpng" />
PORTUGUÊS
Este plugin resolve os problemas de transparência em PNG no Internet Explorer 6.
Ele procura por todas as imagens e as coloca em background com um filtro de opacidade, substituindo a imagem original por um gif transparente de 1px.
Como usar
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/fixpng.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("body").fixPng();
});
</script>
O código de iserção das imagens é normal:
<img src="img/imagem.png" alt="png image" />
Opções
$("body").fixPng( [ string gif_file, string attr, string noreplace ] );
gif_file – Se você for usar um gif diferente de “img/vazio.gif”, use esta opção para definir o caminho correto.
attr – Se você não deseja aplicar o filtro em uma determinada imagem, use esta opção para definir o atributo da imagem que não terá o filtro. O padrão é o atributo ‘rel’.
noreplace – O valor do atributo definido acima. O padrão é ‘noreplace’.
Exemplo
$("body").fixPng( "images/null.gif", "class", "nofixpng" );
Imagem que não terá o filtro
<img src="img/imagem.png" class="test nofixpng" />
Licence/Licença
This plugin is under GNU GENERAL PUBLIC LICENSE.
