Advertisement

davidlars99 Login Name
Premium Service Member Account Type
351,883 Expert Points
04/13/2004 Registration Date
0 Points this month
Expert Certifications:
davidlars99 has earned the following certifications.
Member Profile:
- 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.getElementById(obj);
       var offsetX=0;
       var offsetY=0;
       while (offObj)
       {
              offsetX+=offsetObj.offsetLeft;
              ofsetfY+=offsetObj.offsetTop;
              offsetObj=offsetObj.offsetParent;
       }
       if (navigator.userAgent.indexOf("Mac")!=-1&&typeof document.body.leftMargin!="undefined")
       {
              offsetX+=document.body.leftMargin;
              offsetY+=document.body.topMargin;
       }
       return {left:offsetX,top:offsetY};
}

// usage
var element=getElementXY("myObjectID");

alert(element.left);  
alert(element.top);
 
808 Questions Participated In
4,208 Comments Posted
Date Points Title Activity Type Status Zone
1 09/09/2008 500 Regex for complex path Comment PAQ JavaScript
2 08/04/2008 500 static members and class disposal Comment Deleted C#
3 04/11/2008 500 SQL 2005. The database MSDB is … Discussion PAQ SQL Server 2005
4 01/22/2008 500 True effect of GC.SuppressFinalize(… Comment PAQ C#
5 01/22/2008 500 Static variable initialization (static con… Comment PAQ C#
 
418 Questions Asked
0 Questions Open
317 Questions Graded
101 Questions Deleted