Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Distance from the top of the window to an element

Status
Not open for further replies.

gr8gonzo

MIS
Feb 6, 2001
21
US
Hi,
Basically I need to get just that - the distance from the top of the window to an element, namely an image, but without specifically defining the top property in a STYLE attribute, because the image will change its vertical location from page to page. I have posted an example here:


Please check out my existing code before posting. Thank you!
 
in IE you can use document.element.offsetTop and document.element.offsetTop adam@aauser.com
 
Actually, I've got IE working already, but need a fix for Netscape.
 
Interesting - this could be the key to my resolution fix.
b2 - benbiddington@surf4nix.com
 
check devedge.netscape.com for ns... i tried ooking through their docs, but its impossible to find anything there. adam@aauser.com
 
You may just add a 1-pixel transðarent GIF file at the top of a page, specifying it's dimentions - it's a well-knows and commonly used trick of web designers.
It's also worth to add this to a <body> tag:
topmargin=0 marginheight=0

Andrew | starway@mail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top