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 th开发者_如何学JAVAough it is inside an iframe?
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.
精彩评论