Chrome 無法使用 style.left style.top

今天遇到一個相容性的問題
在IE中可以用
style.left = pos.x;
style.top = pos.y;

但在Google瀏覽器內不行
Javascript無法設定位置

經查證後是要加入單位就可以
style.left = pos.x + "px";
style.top = pos.y + "px";

留言

熱門文章