来者有分,超级郁闷中,javascript代码如何改变<img>的尺寸大小,在线急 var dd=document.getElementById("Img1");dd.style.width='100px';dd.style.height='100px';试试吧 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 document.getElementById("Img1").style.width=100; document.getElementById("Img1").style.height=100; <html xmlns="http://www.w3.org/1999/xhtml" ><head runat="server"> <title>未命名頁面</title> <script language="javascript" type="text/javascript">// <!CDATA[function Button1_onclick() {document.getElementById('img1').style.height=30;document.getElementById('img1').style.width=30;}// ]]></script></head><body> <form id="form1" runat="server"> <img id="img1" src="Image/P2P_1.jpg"/> <input id="Button1" type="button" value="button" onclick="return Button1_onclick()" /> </form></body></html> document.getElementById("Img1").style.width=100; document.getElementById("Img1").style.height=100; 没问题啊,不过最好是设置style中的width和height<html><head><title></title></head><body><input type='button' onclick='setSize()' value='重新设置'/><br/><script>function setSize(){ var im=document.getElementById("img1"); im.width=100; im.height=100;}</script><img id='img1' src='xx1.gif'/></body></html> 解决了,因为不要在STYLE中设置WIDTH&HEIGHT 關於移動範圍問題,來者都有分! 【Jquery】请各位朋友进来帮忙解决一下 recruit programmer 指定选取td的特定行问题? 想实现一个类似IE的自定义工具栏的网页界面 请问一下一般网页上都需要屏蔽那些特殊字符?如何屏蔽? 能不能实现这样的功能?内详,请进! 不太明白,谁帮忙解释解释! 怎样在服务器端创建对象呀 submit按钮检测 Image对象的fileSize属性的问题 播放声音问题
document.getElementById("Img1").style.height=100;
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>未命名頁面</title>
<script language="javascript" type="text/javascript">
// <!CDATA[function Button1_onclick() {
document.getElementById('img1').style.height=30;
document.getElementById('img1').style.width=30;
}// ]]>
</script>
</head>
<body>
<form id="form1" runat="server">
<img id="img1" src="Image/P2P_1.jpg"/>
<input id="Button1" type="button" value="button" onclick="return Button1_onclick()" />
</form>
</body>
</html>
document.getElementById("Img1").style.height=100;
<head>
<title></title>
</head>
<body>
<input type='button' onclick='setSize()' value='重新设置'/><br/>
<script>
function setSize()
{
var im=document.getElementById("img1");
im.width=100;
im.height=100;
}
</script>
<img id='img1' src='xx1.gif'/>
</body>
</html>