个人改良了一下做做成函数:
调用函数
$(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;} }); }
本文共 263 字,大约阅读时间需要 1 分钟。
个人改良了一下做做成函数:
调用函数
$(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;} }); }
转载地址:http://dvjyl.baihongyu.com/