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卻正常能夠運行。
關于this問題
qq_ToutAn諾塵_0
2016-01-26 15:50:30