views:

45

answers:

1

I am making an iframe facebook application. When I had it running as a normal website this:

$('html,body').animate({scrollTop: $("#"+id).offset().top},'slow');

worked fine.

Now it is inside the facebook iframe and the iframe is resized to fit its contents. As a result there is no longer a scroll bar on the iframe and to navigate you use the parent windows scroll bar. I imagine this is what is causing the problem.

Is it possible to achieve the same effect even though it is inside an iframe?

A: 

I doubt this is doable. If your page is on your domain and the iframe is at facebook.com, you won't be able to access things outside the frame (including the root element of the actual page) due to browser security.

If it's enough to get the page to move to a certain point, you might get lucky with element.scrollIntoView(), but I can't remember how well that's supported across browsers.

Matti Virkkunen
That's what I figured... only way I could get it to move around at all was with <a id="woop">Woop</a> <a href="#woop">Click</a>
Sarah