如何知道原图大小,<img width=30 height=30.....这样,但很可能原图不是这个大小,如何知道原图大小? <img width=30 src=''>限定图片宽度为30,自动缩放高度.<img height=30 src=''>限定图片高度为30,自动缩放宽度. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 加入js来控制啊,首先不限制高度和宽度,取得值以后再限制:<img id="myImg" src=""><script language="javascript"> alert(myImg.length); alert(myImg.width); myImg.length=30; myImg.width=30;</script> 顶一下!----------------------请大家支持一下我的网站 http://www.940.cn 图像地址<input type="file" onchange="img.src=this.value">高<input type="text" name="h">宽<input type="text" name="w"><div style="position:absolute;top:;left:0;visibility:hidden"><img id="img" onload="Show(this)"></div><script language="JavaScript">function Show(oImg){ document.all.h.value=oImg.height; document.all.w.value=oImg.width;}</script> <script language=javascript>var i1=new Image();i1.src='c:\winnt\winnt.bmp';alert(i1.width);alert(i1.height);</script> .src用"c:\"这种形式好像有点问题,用相对路径就好了 js连接条码打印机 关于document.write 菜鸟入门问题:为什么我这样写会没有反应呢 IE后退按钮如何屏蔽 js控制图片问题 右下角固定漂浮的问题?求助 求替换内容中的部分格式的方法,在线等待! javascript和c程序的交流问题 请教高手!网页中打开文件时自动导入对应程序工具栏的问题 extjs 如何把属性删掉?比如img width 内有代码 这个问题看看有谁知道怎么解决?
<img id="myImg" src="">
<script language="javascript">
alert(myImg.length);
alert(myImg.width);
myImg.length=30;
myImg.width=30;
</script>
----------------------
请大家支持一下我的网站 http://www.940.cn
高<input type="text" name="h">
宽<input type="text" name="w">
<div style="position:absolute;top:;left:0;visibility:hidden">
<img id="img" onload="Show(this)">
</div>
<script language="JavaScript">
function Show(oImg)
{
document.all.h.value=oImg.height;
document.all.w.value=oImg.width;
}
</script>
var i1=new Image();
i1.src='c:\winnt\winnt.bmp';
alert(i1.width);
alert(i1.height);
</script>