个人改良了一下做做成函数:
调用函数
$(document).ready(function(){ autoImg("#text2 img",600);autoImg("#text1 img",600);});
函数
function autoImg(tNmae,wValue) { $(tNmae).each(function(){ if (this.width>wValue) {this.width = wValue;} }); }
博客园 © 2004-2025 浙公网安备 33010602011771号 浙ICP备2021040463号-3