Question about scroll - jquery

0

I have a button as part of the content of an html file - > this one in turn within an iframe - > the iframe in turn within the mother website.

How can I indicate with jquery the button that makes the mother page that contains everything scroll up with animation and speed fast ?

    
asked by psy 23.03.2017 в 17:46
source

1 answer

1

You must access the parent window object using window.parent . The object window general does not have a parent, only have the iframes, object or the obsolete, frame. From there select the body to animate it:

$(window.parent.document.body).animate({ scrollTop: 0 }, 'fast');
    
answered by 21.04.2017 в 15:13