0

I have an iframe and I want to set the scroll position to that

<iframe id="quraniframe" width="100%" height="1100px" src="https://quran.com/1?locale=fa" frameborder="0"></iframe>

and this is my JavaScript code's

    $(function() {

        $('#quraniframe').contents().scrollTo(0, 30);
        window.alert("scroll = " + scroll);
})

and this is result in an alert

scroll = undefined

Actually, I use this code to and no effect in iframe content

Sweta Jain
  • 3,248
  • 6
  • 30
  • 50
reza er
  • 1
  • 3
  • Does this answer your question? [Scrolling an iframe with JavaScript?](https://stackoverflow.com/questions/1192228/scrolling-an-iframe-with-javascript) – gru Jan 21 '22 at 10:02
  • `scroll` will be undefined, unless it's declared somewhere – Djave Jan 21 '22 at 10:24

0 Answers0