谁有图片超出范围就自动缩小的代码?? 谁有图片超出范围就自动缩小的代码??js的。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 按比例缩放var flag=false;function DrawImage(ImgD){var image=new Image();image.src=ImgD.src;if(image.width>0 && image.height>0){ flag=true; if(image.width/image.height>= 130/80) { if(image.width>130) { ImgD.width=130; ImgD.height=(image.height*130)/image.width; } else { ImgD.width=image.width; ImgD.height=image.height; } //ImgD.alt=image.width+"×"+image.height; } else { if(image.height>80) { ImgD.height=80; ImgD.width=(image.width*80)/image.height; } else { ImgD.width=image.width; ImgD.height=image.height; } //ImgD.alt=image.width+"×"+image.height; } }} <img src="..." onload="autoresize(this)">function autoresize(obj){ if(obj.width>800) obj.width=800;} TabPanel嵌套GridPanel不显示 前台的值传不到后台 flex结合java连接数据库 用ajax dwr框架 急,你们进来看看吧.肯定知道的 请高手帮忙呀?网页上的天气预报是怎么实现的呀 100分请教,一个很实用的问题,快来接分。 求救!!!很急.....谢谢帮忙!!!!(一个白痴的问题,有重谢) 同样的$.ajax()调用两次,在IE8下只进入一次Action web.xml设置session超时时间10分钟以内有效,10分钟之后无效 JSP页面中域名的检查怎么实现? struts框架中,如何在点击“关闭”按钮后使session无效??
var flag=false;
function DrawImage(ImgD){
var image=new Image();
image.src=ImgD.src;
if(image.width>0 && image.height>0){
flag=true;
if(image.width/image.height>= 130/80)
{
if(image.width>130)
{
ImgD.width=130;
ImgD.height=(image.height*130)/image.width;
}
else
{
ImgD.width=image.width;
ImgD.height=image.height;
}
//ImgD.alt=image.width+"×"+image.height;
}
else
{
if(image.height>80)
{
ImgD.height=80;
ImgD.width=(image.width*80)/image.height;
}
else
{
ImgD.width=image.width;
ImgD.height=image.height;
}
//ImgD.alt=image.width+"×"+image.height;
}
}
}
if(obj.width>800)
obj.width=800;
}