window.onload=function(){
var aLi =document.getElementById("li1");
aLi.onmousemove=function(){ // 必须是aLi,不能是this????
startMove(aLi,'width',200,function(){
startMove(aLi,'height',200,function(){
startMove(aLi,'opacity',100);
});
});
}
}
在startMove()中为什么aLi都写成this不行呢,控制台显示
Uncaught TypeError: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'.
191move.js:9 Uncaught TypeError: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'.
这错误。全部改成aLi却正常能够运行。
Perona
小红红乖乖
js_saber