iltdev iltdev - 1 year ago 164
jQuery Question

jQuery scroll to top of iframe parent

I have an iFrame with a feedback form in it. After the user clicks submit, I want use parent window to scroll to the top. I know I can scroll to the top of a page with:

$('html, body').animate({scrollTop:0}, 'slow');

However, this will only scroll the contents of the iframe, not the parent page.
Any suggestions?

xar xar
Answer Source

Give a try for this one :

window.parent.$("body").animate({scrollTop:0}, 'slow');
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download