Click to See Complete Forum and Search --> : onload Iframe/child to reset parent x, y


donbudz
02-01-2009, 08:54 AM
Hi, hoping someone can help me with an onload script.
I have a page with an IFRAME in it. When a page loads into my IFRAME i want the main/parent page to scroll down to where the IFRAME is positioned.
So i need an "onload" script to put into my page thats loading into the IFRAME that will call the parent to moveTo or scrollTo new position. I dont want the parent to scroll down until the child page loads. Can anyone help me with this? Thanks in advance!

auto_web
02-04-2009, 05:42 AM
put something like <a name="frame"></a> just before the iframe
and when linking to your page do it like link.html#frame

or see if this (http://flesler.blogspot.com/2007/10/jqueryscrollto.html) is of any help

donbudz
02-04-2009, 08:09 AM
Little more info on what I am doing.
I have a Flash Menu at the top of "Parent window" when a user clicks a button in the Flash Menu a page will load into the IFRAME. The IFRAME is located at bottom of "Parent window". It is located off screen the user will not see it load.
I need the "Parent window" to scroll down to the IFRAME when user clicks the button in the flash menu at the top of "Parent window". I need to have either a button action in Flash or a script in IFRAME page to scroll "Parent window" to IFRAME position. I do not want the "Parent window" to refresh as this will reload my flash movie. Thanks for any help. PS i am kinda a noobie!

donbudz
02-04-2009, 08:15 AM
What I'm working on is located here:
http://www.donswebdesigns.com
This is site is work in progress, IFRAME is located at bottom of page.

Fang
02-04-2009, 09:18 AM
The document in the iframe must have an onload that scrolls the top document.

donbudz
02-04-2009, 11:15 AM
The document in the iframe must have an onload that scrolls the top document.
EXACTLY!! thank you Fang!
Anyone, help me with that?

Fang
02-04-2009, 12:15 PM
window.onload=function() {parent.iframeName.scrollInToView();};

donbudz
02-04-2009, 02:11 PM
Thanks for the response Fang, however, its not working for me. I put the line u posted into my IFRAME page and it done nothing. I may not be putting the line into my code correctly. Is there a certain place I put this line or a tag i need to add to it? Thanks for your help with this.

Fang
02-04-2009, 02:24 PM
Isn't the forum loaded into communicator_main?

donbudz
02-04-2009, 02:51 PM
um ya... 'bout that..
Index is the parent page,
first generation IFRAME is "communicator"
second generation IFRAME is "communicator_main"
"generalforum_loader.html" loads into "communicator_main"
then the forum loads... "/general/index.php"

donbudz
02-04-2009, 02:59 PM
...so i actually have an IFRAME within an IFRAME.
parent.communicator.communicator_main
im using the pre-loader page for the onload event to reset parent position.
the page i want to use this onLoad event is located
"parent.communicator.communicator_main"

donbudz
02-04-2009, 03:48 PM
still i cant just throw that code in anywhere can i? isnt that jave script? shuldnt there be <script="java language"> </script> on there?

donbudz
02-04-2009, 10:18 PM
Flash movie to link to HTML anchor:
FLASH BUTTON ACTION (link to anchor)
"flash.swf" movie
on (release) {
getURL("my.html#bottom");
}

HTML CODE (anchor) placed rite above IFRAME or any location you want in the HTML
"my.html" page
<a name="bottom"></a>

Also this works without refreshing the page!
Thanks Auto_Web and Fang for your help.

donbudz
02-04-2009, 11:04 PM
ok.. my bad it refreshes the parent page. For whatever reason it only does it once.. then no more refreshing.. weird. I'm lookin for away to goto anchor without refresh.

donbudz
02-05-2009, 12:50 AM
Think I have got it now!!
To keep Main/Parent page from reloading when linking to the
anchor, I simply put the anchor in the IFRAME page.
Had to change the Flash Button Action a bit.
Flash Button Action (targeting anchor within IFRAME page)
on (release) {
getURL("my.html#bottom", "IFRAME_name");
}
Thanks, later dudes