★img タグに必ず name=*** (span や div タグにはid=***) style="position: absolute" をつける ★オブジェクトの左上点の座標 赤玉の obj.offsetLeft, 赤玉の obj.offsetTop・・・画面の左上から 幅 高さ 赤玉の obj.offsetWidth, 赤玉の obj.offsetHeight★スクリプト
HelloHello の obj.offsetLeft, Hello の obj.offsetTop・・・画面の左上から ★画面の幅と高さ body.clientWidth? body.offsetWidth? body.clientHeight? body.offsetHeight?
★オブジェクトの移動 obj.style.posLeft=obj.style.posLeft+10; obj.style.posTop=obj.style.posTop+10; obj.style.posLeft=500; obj.style.posTop=200;
function yoko(obj){ obj.style.posLeft=obj.style.posLeft+10; } |
function tate(obj){ obj.style.posTop=obj.style.posTop+10; } |
function ichi(obj,x,y){ obj.style.posLeft=x; obj.style.posTop=y; } |