How to bring the content of iframe back to the top

Source: Internet
Author: User
, How to click the gotop button outside iframe to make the content in iframe return to the top. I tried a few of them, but have you ever done it. The premise is that the iframe page cannot be modified.

, How to click go top button outside iframe to makeContent in iframeReturn to the top.
I tried a few of them, but have you ever done it.
The premise is that the iframe page cannot be modified.

Reply content:

, How to click go top button outside iframe to makeContent in iframeReturn to the top.
I tried a few of them, but have you ever done it.
The premise is that the iframe page cannot be modified.

If the domain name is not cross-origin, it can be as follows:

Var iframeElement; // select iframeiframeElement. contentWindow. scrollTo (0, 0 );

I have no solution in the case of cross-origin

DEMO

Register the slide to the top method in the iframe document. when the click event is triggered on the external page, find the iframe and then call this method.

Are you doing this on a local page? That cannot be done. set up a server and try again.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.