问个HyperLink的图片 <asp:HyperLink Target="_blank" ID="img5" Height="90px" Width="966px" runat="server"></asp:HyperLink>我想控制这个图片的高度和宽度,怎么弄? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 不是可以了,属性那里代码也可以的 img5.Width, Height 这样你还不如直接用IMG 外面套A标签或者把A标签的背景改成图片<a href=""><img id="aa" src="a.jpg" /></a> 用hyperlink或者a标签都可以里面放<img></img>,设置img的width和height HyperLink只连接图片地址,用image控制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>= 140/120){ if(image.width>140){ ImgD.width=140; ImgD.height=(image.height*140)/image.width; }else{ ImgD.width=image.width; ImgD.height=image.height; } } else{ if(image.height>120){ ImgD.height=120; ImgD.width=(image.width*120)/image.height; }else{ ImgD.width=image.width; ImgD.height=image.height; } } } } image中onload="javascript:DrawImage(this)"> JQuery -Treeview 动态添加结点后无法展开 简单的错误 如何操作动态生成的控件?就是找不到动态生成的控件 页面提交回服务后怎么保持js类中的状态 【急!】sharepoint安装报“指定的日志文件路径无效”! 不知道可不可以这样做,关于多个 web.config 的问题 研究 microsoft enterprise library 时,遇到的问题。。 怎样限制下载的连接数? 怎样调用另外一个页面的控件? xml小问题 在asp.net中当从一个页面返回到调用页面时,数据被刷新了,如何不刷新呢 HyperLink控件链接到文件时,如何在点击后弹出“打开”“保存”“取消”对话框?
代码也可以的 img5.Width, Height
或者把A标签的背景改成图片
<a href=""><img id="aa" src="a.jpg" /></a>
里面放<img></img>,设置img的width和height
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>= 140/120){
if(image.width>140){
ImgD.width=140;
ImgD.height=(image.height*140)/image.width;
}else{
ImgD.width=image.width;
ImgD.height=image.height;
}
}
else{
if(image.height>120){
ImgD.height=120;
ImgD.width=(image.width*120)/image.height;
}else{
ImgD.width=image.width;
ImgD.height=image.height;
}
}
}
}
image中onload="javascript:DrawImage(this)">