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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

absolute positioning of an iframe

Status
Not open for further replies.

mmorancbt

IS-IT--Management
Nov 11, 2002
367
US
I have a list that includes an image I click to reveal an iframe with some additional information and editing information. The list requires - at times - scrolling down the screen.

I return the event.y position and use that to position my iframe "style.top"

The problem is when I've scrolled down the screen, the iframe is positioned up towards the top of the HTML document - the top being relative to the top of the document.

I want to position it to the right of where I click the mouse?

I know I'm missing something obvious. What is it?

Thanks.

Matthew Moran (career blog and podcast below)
Career Advice with Attitude for the IT Pro
 
It sounds like you might want the "scrollTop" property:


MSDN said:
... retrieves the distance between the top of the object and the topmost portion of the content currently visible in the window.

Incidentally, if you need your code to work in anything other than IE, you'll need to rewrite your event handling... "event" is IE-only.

Hope this helps,
Dan

Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top