Jul
04
2012
jquery 限制图片大小
jQuery.fn.ImageAutoSize = function(width,height) { $("img",this).each(function() { var image = $(this); if(image.width()>width) { image.width(width); image.height(width/image.width()*image.height()); } if(image.height()>height) { image.height(height); image.width(height/image.height()*image.width()); } }); } // $(function(){ $(".art_body").ImageAutoSize(670,800);});
最活跃的读者