Sam
Sam

Reputation: 57

ScrollTo or ScrollLeft. Div inside of Iframe

I am trying to have a div on a html page that gets loaded into an iframe scroll to a certain horizontal position onload. But I can't get it working. With some simple body onload code in the html page, I get the div to scroll to a certain point. But when loaded into an iframe it doesn't happen anymore.

this is the code I now have in my Iframe, but it doesn't do much..

<iframe id='idframe' style='width:23300px; height: 650px; border:none; overflow: hidden;' src='http://www.foundfootage.be/kijk3.html'

onload="this.contentWindow.getElementById("images_hz").scrollLeft=100"

anyhelp much appreciated

Upvotes: 0

Views: 201

Answers (1)

zggz12
zggz12

Reputation: 133

I don't know for sure...but my guess would be that the javascript code would need to be inside the iframe...

Upvotes: 0

Related Questions