Posted By

marcio on 01/25/10


Tagged

javascript jquery img


Versions (?)

suavizar imágenes redimensionadas en IE


 / Published in: jQuery
 

  1. //recorre las imágenes redimensionadas solo en IE y les aplica el filtro necesario para suavizarlas
  2. if ($.browser.ie) {
  3. $('img').each(function() {
  4. ancho_forzado = $(this).width();
  5.  
  6. img = new Image();
  7. img.src = $(this).attr('src');
  8. ancho_real = img.width;
  9.  
  10. if (ancho_forzado != ancho_real) {
  11. if ($.browser.version.substr(0,1) == '7') {
  12. this.style.msInterpolationMode = "bicubic";
  13. } else if ($.browser.version.substr(0,1) == '6') {
  14. $(this).attr('width', ancho_forzado);
  15. this.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + img.src + "', sizingMethod='scale')",
  16. this.runtimeStyle.paddingTop = this.height,
  17. this.runtimeStyle.height = 0;
  18. }
  19. }
  20. });
  21. }

Report this snippet  

You need to login to post a comment.