Click to See Complete Forum and Search --> : Popups from an iframe


Webskater
08-27-2003, 01:34 PM
I have an iframe on a page that displays a recordset that may be quite long. One of the fields contains a long string so I pass the string to a function to crop it to fit the cell it is in. I also pass the whole string to a function that calls a Popup window that shows the whole string if the cell with the cropped string is mousedover. (Hope thats clear!)
I have set the Popup window to popup right next to the cell that 'calls' it.
However, if the iframe is scrolled so that a cell that was a long way down out of sight comes into view, when you mouseover to get the popup the popup appears relative to where the cell used to be i.e. down near the bottom of the page. This does not happen if you do the same type of thing using <title>.
Does anyone know how I can get the popup to realise it is being called from a different place on the page after the iframe has scrolled.
Thanks for any help.

Khalid Ali
08-28-2003, 07:17 AM
Yes my guess is you are showing the popup at the same location as it apears the first time.

What you need to do is add the scrollTop into the X co-ordiantes which you get from mouseoever event.

Webskater
08-28-2003, 02:42 PM
Thanks for your reply Khalid.
I have looked up scrollTop and it says to use it like:
element.scrollTop
It does not seem to matter what element I put in (a table or span tag - whatever) all it sends back is 0.
What am I doing wrong?
Thanks again.

Webskater
08-28-2003, 03:20 PM
When I looked it up it said that scrollTop applied to all sorts of things tables, cells, rows etc but not iframes.
Is it supposed to tell you how far a table has scrolled in an iframe? All it gives me back is 0.