团学活动

学生

共50条记录, 共5页 12345 >> 跳转到Go
$(window).load(function() { $(".right_img").each(function(){ $img = $(this).find("img"); $w = $img.width(); $h = $img.height(); /* sr = $img.attr("src") alert(sr+","+$w+","+$h)*/ $bw= $(this).width(); $bh= $(this).height(); b1 = $w/$h; b2 = $bw/$bh; if(b1>b2){ $img.css("height","100%") $wed = $bh*b1; $img.css("width",$wed+"px") fz =($(".right_img").width()-$wed)/2; $img.css("margin-left",fz+"px") }else{ $img.css("width","100%") $hed = $bw/b1; $img.css("height",$hed+"px") fs =($(".right_img").height()-$hed)/2; $img.css("margin-top",fs+"px") } }); });
0