天使半只翼

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

个人改良了一下做做成函数:

调用函数

$(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;}
     });    
}
posted on 2012-11-15 12:55  天使半只翼  阅读(731)  评论(0编辑  收藏  举报