views:

65

answers:

1

My site is affiliated in another site iframe.

The hosted site got the iframe on fix height inside a span with a scroll (don’t ask why).

I’m looking for a way to change the span scroll (with JS) from within the iframe (where my site is).

I know it can be done because I use JqueryUI dialog with position:top (inside the iframe)

which scrolls the span to the top (outside the iframe)

Html:

<body style="overflow:hidden;">
            <span style="float: left; height:488px; overflow-y:auto;">
                <table>
                    <tr>
                        <td>
                                <iframe id="Iframe" name="Iframe" src="Login.aspx"
                                width="775px" height="4000px"></iframe>
                        </td>
                        <td style="width: 200px; height: 600px; font-size: 25px; border: 1px solid #000000;" valign="top">Side Bar</td>
                    </tr>
                </table>

            </span>

+1  A: 

window.parent.$("span").whateverYouWantToDo();

works only if iframe content is in the same domain as main window.

When there is a different domain You can only catch the load event from the main window. Try reacting on that. And see what You can do with

document.location.hash

it might be accessible from the main window, but it's not cross browser

naugtur