个人改良了一下做做成函数:
调用函数
$(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;} }); }
个人改良了一下做做成函数:
调用函数
$(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;} }); }
相关文章: