Netscape float

9月 16, 2006 · Posted in css · コメントは受け付けていません。 

Netscapeでは下記の指定が効かない
[object].style.float= “left”;

指定したレイヤーの座標を取得

9月 16, 2006 · Posted in javascript · Comment 

概要

指定したレイヤーの座標を取得します。

Java Script
function getElementPosition(eremID){
var offsetTrail = document.getElementById(eremID);
var offsetLeft = 0;
var offsetTop = 0;
while(offsetTrail){
offsetLeft += offsetTrail.offsetLeft;
offsetTop += offsetTrail.offsetTop;
offsetTrail = offsetTrail.offsetParent;
}
if(navigator.userAgent.indexOf("Mac") != -1 &&
typeof document.body.leftMargin != "undefined"){
offsetLeft += document.body.leftMargin;
offsetTop += document.body.topMargin;
}
return{ left:offsetLeft , top:offsetTop }
}

エンコード・デコード

9月 7, 2006 · Posted in javascript · コメントは受け付けていません。 


encode      decode