GIF Skyrama BR 01 300x250
Página Inicial > geral > fixPng Jquery Plugin ie6

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.


Related Posts Plugin for WordPress, Blogger...

Posts Relacionados:

Deixe seu comentário

  1. 26, maio, 2010 em 09:05 | #1
    se o que vc precisa é de um script em js puro, use o ie7-js
    ele corrige, além desse problema, diversos outros problemas de compatibilidade do IE (png transparente no ie6, problemas com css nos demais)
    http://code.google.com/p/ie7-js/
    para usar, você simplesmente inclui o seguinte código na página:

    veja mais na página do projeto
    espero ter ajudado alguém, abraço!

  2. 26, maio, 2010 em 09:07 | #2
    @robertocr
    o wordpress comeu o código hehehe
    entre em http://code.google.com/p/ie7-js/ e veja o projeto, ele é fácil de usar, muito bom e famoso
  3. Michel
    5, janeiro, 2011 em 15:45 | #3
    ao usar este código no IE6 ficou aparecendo em cima da imagem png o quadrado e x que aparecem quando não tem nenhuma imagem no local indicado no site apesar de ficar aparecendo a imagem png em baixo. como resolvo isso?
  1. 24, agosto, 2011 em 17:58 | #1

SEO Powered by Platinum SEO from Techblissonline