document.getElementById("clock").style.top = 40;
style 属性可以这么赋值 但是
document.getElementById("clock").style.top 在取值的时候 返回的全部都是 字符串
比如此处 应该输出 "40px";
var bt = document.getElementById("clock");
window.setInterval(function(){
if(bt.style.top)
bt.style.top = parseInt(bt.style.top) + 40 + "px";
else bt.style.top = "40px";
},250);
style 属性可以这么赋值 但是
document.getElementById("clock").style.top 在取值的时候 返回的全部都是 字符串
比如此处 应该输出 "40px";
var bt = document.getElementById("clock");
window.setInterval(function(){
if(bt.style.top)
bt.style.top = parseInt(bt.style.top) + 40 + "px";
else bt.style.top = "40px";
},250);


