window.onload=function(){ for(var i=0;i<100;i++) { var em=document.createElement('span'); em.id="snow"; em.innerText="*"; document.body.appendChild(em); snow(em); } } function snow(obj){ var speedY=Math.random()*3+2; var speedX=4-speedY; var w=document.body.clientWidth-obj.offsetWidth; var h=document.body.clientHeight-obj.offsetHeight; var otop=obj.style.top; var oleft=obj.style.left; otop=speedY+'px'; //不报错 obj.style.top=speedY+‘px’; //报错为什么呢????????
添加回答
举报
0/150
提交
取消