Ver Mensaje Individual
  #1 (permalink)  
Antiguo 11/11/2008, 06:24
SoutlinK
 
Fecha de Ingreso: junio-2007
Mensajes: 189
Antigüedad: 16 años, 10 meses
Puntos: 3
[jQuery] Por que no funciona este código

Código javascript:
Ver original
  1. // JavaScript Document
  2. $(document).ready(
  3.     function()
  4.     {
  5.         resize_images();
  6.     }
  7. );
  8.  
  9. function resize_images()
  10. {
  11.     var MAX_WIDTH = 640;
  12.     var MAX_HEIGHT = 480;
  13.    
  14.     $("#pagecontent img").each(
  15.         function()
  16.         {
  17.             var IMAGE_WIDTH = $(this).width();
  18.             var IMAGE_HEIGHT = $(this).height();
  19.            
  20.             if (IMAGE_WIDTH > MAX_WIDTH)
  21.             {
  22.                 $(this).width(MAX_WIDTH);
  23.             }
  24.         }
  25.     );
  26. }

Funciona perfectamente con Mozilla Firefox, pero no con Internet Explorer ni con Google Chorme