你的元素A没有设置,如果下面的语句不写style="top:30px"则会报NaN
<div id="div1" style="top:30px">
sadfsdf</div>
<script language=javascript>
alert(parseInt(document.getElementById("div1").currentStyle.top))
</script>
<div id="div1" style="top:30px">
sadfsdf</div>
<script language=javascript>
alert(parseInt(document.getElementById("div1").currentStyle.top))
</script>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货