WebFX WebBoard
Message Thread:
View All Messages
Back to WebFX
 Element's Position, Al Val, March 16, 2004
     Re:Element's Position, Anders Both, March 23, 2004
         Re:Element's Position, Erik Arvidsson, March 26, 2004
             Re:Element's Position, Al Val, March 29, 2004
         Re:Element's Position, Al Val, March 24, 2004

Subject: Re:Element's Position From: Al Val Date: March 24, 2004

Thanks, But I need to find element's position from the write.
Your functions finding the position from the left and the top.

Al.

From: Anders Both
Sent: March 23, 2004
Subject: Re:Element's Position

 

Maybe these to methods can help you, they are made by me some years ago, but stil going strong. (I have been told , that they are not 100% perfect, but the have always been working for me)

Good luck,


function offsetLeftToBody(obj)
{
 var left;
 left = obj.offsetLeft;
 while (obj.tagName != "BODY")
  {
   obj=obj.offsetParent;
   left += obj.offsetLeft;
  }
 return left;
}

function offsetTopToBody(obj)
{
 var top;
 top = obj.offsetTop;
 while (obj.tagName != "BODY")
  {
   obj=obj.offsetParent;
   top += obj.offsetTop;
  }
 return top;
}


 

From: Al Val
Sent: March 16, 2004
Subject: Re:Element's Position

Hi,

How can one find the position of an Element from the right?
I am using the dir="rtl" attribute.

Thanks,
Al.






Reply
Name: 
Email: 
Subject: 

Enter your reply to this message below. HTML tags are not supported but words that start with http://, ftp:// or mailto: are converted to links.


View All Messages
Back to WebFX