<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head><body bgcolor="#FFFFFF" text="#000000" onload="ini()">
<img id="guagua" src="zdd.jpg">在这里添加你的图片地址
<script language="JavaScript">
function ini()
{if(guagua.width>200)guagua.widht=200;
if(guagua.height>200)guagua.height=200;
}
</script>
</body>
</html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head><body bgcolor="#FFFFFF" text="#000000" onload="ini()">
<img id="guagua" src="zdd.jpg">在这里添加你的图片地址
<script language="JavaScript">
function ini()
{if(guagua.width>200)guagua.widht=200;
if(guagua.height>200)guagua.height=200;
}
</script>
</body>
</html>
解决方案 »
- js 求助 高手来~~清囊相送~
- 怎么样实现先隐藏table,然后点击按钮后,显示按钮,display属性等于什么值时是显示的意思。在线等
- 如何把小写金额 转成大写
- 在元素id中能不能用数组?
- 如果想让一个javascript函数在页面刚打开时就执行,怎么做?
- yahoo.com/切换到宽屏后,有一个quick tour,他怎么事先后面链接不能点击的?而前面的层可以
- 一段简单的代码怎么就出错了?
- 我做的VML机械机构运动仿真程序,连杆总是跟铰链中心有偏离,而且有轻微的颤动,请大家来研究研究!
- SOS:如何在JavaScript中实现这个小功能? many thanx :)
- JavaScript中设置width的小问题
- 新闻信息发布系统,可以和SOHU的相比,想要的进来
- 经过一些时间的研究,得出Netscape兼容性的结论!供大家参考!
guagua.widht->guagua.width
var imarr = [
new Image(),
new Image(),
new Image()
];imarr[0].src = "im0.gif";
imarr[1].src = "im1.gif";
imarr[2].src = "im2.gif";funtion view(n)
{
if(n < 0 || n>imarr.length) return;
var iw = parseInt(imarr[n].width); iw = (iw==0?1:iw);
var ih = parseInt(imarr[n].height); ih = (ih==0?1:ih);
var rate = Math.max(200.0/iw, 200.0/ih);
if(rate == 0) rate = 1;
myIMG.width = Math.floor(iw * rate);
myIMG.height = Math.floor(ih * rate);
myIMG.src = imarr[n].src;
myIMG.style.display = "";
}
</script>
<!-- 这段script放到<head></head>之间-->
<!-- 这段HTML放到<body></body>之间-->
<img id="myIMG" width="0" height="0" src="" style="display:none">
<a href="javascript:view(0)">imgage 0</a>
<a href="javascript:view(1)">imgage 1</a>
<a href="javascript:view(2)">imgage 2</a>