0

What is wrong this way?:

HTML:

 <iframe onload="scrollme(this)" src="somesite.com"></iframe>

Javascript:

 function scrollme(ob) {
     o.scrollTop = 100;
 }
Geromy
  • 1

1 Answers1

0

An iframe doesn't scroll. The viewport is always the size of the iframe, so there is no overflow that can scroll.

If you want the page inside the iframe to scroll, you have to make the document scroll. However that is only possible if the page shown in the iframe is from the same domain.

Guffa
  • 687,336
  • 108
  • 737
  • 1,005