facebox positioning problem when used in iframe page

21 views
Skip to first unread message

evo

unread,
Jul 24, 2008, 7:49:42 AM7/24/08
to facebox
In my case I have to use facebox from within a iframe page, which has
fixed height and doesn't allow scroll. Facebox always open at the top
of the iframe page regardless of the scroll position of the parent
page.

Then I found this code in facebox.js which determines the dialog
position.

$('#facebox').css({
top: getPageScroll()[1] + (getPageHeight() / 10),
...

So facebox decides the dialog position based on the local scroll and
height of the current page only.

And probably because my iframe is from a different domain of the
parent window, I get access denied when tried to get the parent page
coordinates by window.parent. I can't find a workaround for this.

I think a better way is to determine the dialog position based on the
mouse click event which happens at some place on the page. Any way I
can do that? Otherwise I'll have to hardcode a y position for the
facebox dialog for now...
Reply all
Reply to author
Forward
0 new messages