<!DOCTYPE HTML><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>relative样式</title><style type="text/css">div{ width: 200px; height: 200px; background: red; } </style><script type="text/javascript">window.onload=function(){ startMove();}function startMove(){ setInterval(function(){ var oDiv=document.getElementById("div1"); oDiv.style.width=oDiv.offsetWidht-1+'px' } ,30)}</script></head><body> <div id="div1"></div></body></html>
添加回答
举报
0/150
提交
取消