I created a HTML page with several text paragraphs in it. I wanted it to automatically scroll bottom after opening the page. So I used following Javascript and it working fine. let say it is page.html
But then I needed it to display inside an iframe. Let say main page as index.html
, index.html
has iframe tag: <iframe src="./page.html"></iframe>
It also worked while loading inside the iframe within major browsers (chrome, firefox, IE, Opera) but not in Apple's Safari mobile browser.
I tested direct HTML page page.html
with Safari mobile browser and it worked!
But after loaded same page inside an iframe in index.html
it didn't work.
This is the Javascript I have used in page.html
<script language="javascript">
function autoScrolling() { window.scrollTo(0,document.body.scrollHeight); }
setInterval(autoScrolling, 1000);
</script>
Please suggest me a code fix for Apple's Safari mobile browser