Similar Posts

Subscribe
Notify of
4 Answers
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
verreisterNutzer
1 year ago

In a iframe you can also function scrollTo() use to change the scroll position. However, scrollTo() only after loading the iframe-element. To do this onload:

  

You can also use the attribute scrollTop set to the desired value:

var iframe = document.getElementById("iframe");
iframe.onload = function() {
    // scrolle zu Y = 1000
    iframe.contentWindow.document.documentElement.scrollTop = 1000;
};

This, however, does not work on all linked websites, because for safety reasons one does not work on iframe can access another website (see Same Origin Policy).

See this: https://stackoverflow.com/questions/1192228/scrolling-an-iframe-with-javascript

10tel
1 year ago

Within the iframe you can scroll as if the page is not embedded.

From the Elter (parent) document you can place the iframe page when loading with the parameter #kapitel3 to a position id=kapitel3.

What exactly is your desire?

read that Automatic (even do) should be scrolled. This goes through Javascript at any time. Or x seconds after the store.

10tel
1 year ago
Reply to  Bohne47

The iframe is an HTML element and the Elter (parent) can set the height even later when the website is loaded in the iframe.

The iframe website can report its height to its own server via ajax. This creates an image with this height, which is then read and evaluated by the Elter – across domain boundaries. Elter corrects the height of the iframe and the embedded document is completely visible.

It is not known to me that an iframe can be instructed to block the contained document against scrolling. Elter has no right to intervene in the child element.