iltdev iltdev - 15 days ago 5
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

Give a try for this one :

window.parent.$("body").animate({scrollTop:0}, 'slow');
Comments