- Have you heard about the object-oriented way to become wealthy?
- No...
- Inheritance...
davidlars99 {at} gmail {dot} com
A little boy goes to his father and asks, "Daddy how was I born?"
The father answers: "Well son, I guess one day you will need to find out anyway! Your Mom and I first got together in a chat room on Yahoo. Then I set up a date via e-mail with your Mom and we met at a cyber-cafe. We sneaked into a secluded room, where your mother agreed to a download from my hard drive. As soon as I was ready to upload, we discovered that neither one of us had used a firewall, and since it was too late to hit the delete button, nine months later a little Pop-Up appeared that said: YOU GOT MALE!
Many developers are wondering how to get an absolute XY position of a non-absolute HTML element:
// function
function getElementXY(obj)
{
var offsetObj=document.getElem
entById(ob
j);
var offsetX=0;
var offsetY=0;
while (offObj)
{
offsetX+=offsetObj.offsetL
eft;
ofsetfY+=offsetObj.offsetT
op;
offsetObj=offsetObj.offset
Parent;
}
if (navigator.userAgent.index
Of("Mac")!
=-1&&typeo
f document.body.leftMargin!=
"undefined
")
{
offsetX+=document.body.lef
tMargin;
offsetY+=document.body.top
Margin;
}
return {left:offsetX,top:offsetY}
;
}
// usage
var element=getElementXY("myOb
jectID");
alert(element.left);
alert(element.top);