Jump to content

how to scroll inside an iframe


netcracker

Recommended Posts

hi there!in this page that i'm bulding there is an iframe with some external content. external means that is from another server. i cannot modify or temper that content in any way, but i would like to scroll to a certain position from my parent page inside that iframe that i have. :) eg.:

<body onLoad="iframe_name.scrollTo(10,700)">...<iframe name="iframe_name" id="iframe_name" title="iframe_name" src="http://www.xxx.ro/xxx.php" ></iframe>....

this is not working... :) any ideeas? :)

  • Like 1
Link to comment
Share on other sites

hi there!in this page that i'm bulding there is an iframe with some external content. external means that is from another server. i cannot modify or temper that content in any way, but i would like to scroll to a certain position from my parent page inside that iframe that i have. :) eg.:
<body onLoad="iframe_name.scrollTo(10,700)">...<iframe name="iframe_name" id="iframe_name" title="iframe_name" src="http://www.xxx.ro/xxx.php" ></iframe>....

this is not working... :) any ideeas?  :)

try this
<body onLoad="document.frames['iframe_name'].scrollTo(10,700)">...<iframe name="iframe_name" id="iframe_name" title="iframe_name" src="http://www.xxx.ro/xxx.php" ></iframe>

Link to comment
Share on other sites

thx for the swift response

<body onLoad="document.frames['iframe_name'].scrollTo(10,700)">...<iframe name="iframe_name" id="iframe_name" title="iframe_name" src="http://www.xxx.ro/xxx.php" ></iframe>

it gives an error: "Access is denied."

it is quite frustrating since it shouldn't be this hard...also tried:[code]document.frames['convertorvalutar'].contents.scrollBy(10,700)

Link to comment
Share on other sites

The Access denied is what I expected you'd get. You cannot do anything to the document inside the iframe if it is not from the same domain. That obviously include scrolling. Sorry :)

Link to comment
Share on other sites

well, i'm not trying to crack or hack IE or any other browser, but the easyest sollution i've come up with is an iframe that opens a local page which eventualy opens the desired external page, also in an iframe... :) the first iframe has any height, while the 2nd iframe is taller, and so i manage to scroll to any desired position. :) it is no big deal... quite childish actually, but it does the job and that's just what i'm looking for :)hope i make any sense...

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...