height 屬性可設置或返回圖像的高度。
imageObject.height=pixels
下面的例子可設置圖像的高度和寬度:
<html>
<head>
<script type="text/javascript">
function changeSize()
{
document.getElementById("compman").height="250"
document.getElementById("compman").width="300"
}
</script>
</head>
<body>
<img id="compman" src="compman.gif" width="107" height="98" />
<br /><br />
<input type="button" onclick="changeSize()"
value="Change size of image">
</body>
</html>
如對本文有疑問,請?zhí)峤坏浇涣髡搲?,廣大熱心網友會為你解答?。?點擊進入論壇
Powered by 365建站網 RSS地圖 HTML地圖
copyright © 2013-2024 版權所有 鄂ICP備17013400號