Ver Mensaje Individual
  #4 (permalink)  
Antiguo 16/01/2012, 08:07
Avatar de chicohot20
chicohot20
 
Fecha de Ingreso: mayo-2009
Mensajes: 388
Antigüedad: 15 años
Puntos: 43
Respuesta: Consulta JS / jquery / PNG / ie8

El filtro se aplica solo a las imagenes de #contenido2
Código HTML:
Ver original
  1.         <title>Jejeje</title>
  2.         <meta http-equiv="content-type" content="text/html;charset=utf-8">
  3.         <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
  4.  
  5. <script type="text/javascript">
  6. $(function(){
  7.     $("#contenido2 img").each(function(i,img){
  8.         if (img.src) {
  9.             var imgSrc = img.src;
  10.             if (imgSrc.substr(imgSrc.length-4) === '.png' || imgSrc.substr(imgSrc.length-4) === '.PNG') {
  11.                 img.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled='true',sizingMethod='crop',src='" + imgSrc + "')";
  12.             }
  13.         }
  14.     });
  15.     setInterval(function(){ animar()},2000);
  16.     function animar(){
  17.         $("#contenido1,#contenido2").fadeToggle("slow", "linear");
  18.     }
  19. });
  20. </head>
  21.     <div id="contenido1">
  22.         <img src="1.png" alt="" />
  23.     </div>
  24.     <div id="contenido2">
  25.         <img src="2.png" alt="" />
  26.         <img src="3.png" alt="" />
  27.     </div>
  28. </body>
  29. </html>