前几天在开发一个模块的过程中,遇到了一个十分不可思议的事情,令人非常郁闷。
源代码像这样:
document.getElementById("divID").style.top=?;
document.getElementById("divID").style.top=?;
……
document.getElementById("spanID").style.top=?;
document.getElementById("spanID").style.top=?;
在那段js代码当中执行到span和div所在的节点的分界处必须alert("任何值"),否则就不能成功,最后,我想到了div和span两个标签的区别,把问题解决了,真是有点郁闷,花了我太多时间,记下来,下次绝对不能再这样了。