0
我想通過根據屏幕分辨率更改hspace
屬性來更改小應用程序的水平定位。下面的Javascript似乎沒有任何改變:javascript不改變html屬性
<html>
<body>
<applet
id="clientApplet"
archive="client.jar"
code="Client.class"
width="500" height="530"
hspace="100">
</applet>
<br />
<script type="text/javascript">
var leftMargin = (screen.width-500)/2;
document.getElementById("clientApplet").setAttribute(hspace, leftMargin);
window.location.reload()
</script>
</body>
</html>
有誰能告訴我哪裏出錯了嗎?
由於現在運轉。 – user1591837 2012-08-11 06:41:02