Kor
10-22-2003, 10:24 AM
Here's the situation
One parent with an iframe. In the iframe are calling, from menu, some pages. All those pages are long enough to need a button or something for client to be alble to go top of the page from a single click. I want to have that button on the parent page, but i want to scroll the pages in the iframe.
Now, I built a function, written in a JS file, SRC from each "child" pages:
function goUp(){
location.href="#toppage";
{
I want to call that function from within that button placed on the parent.
I tried with:
<a href="page1.html" target="farmename" onclick="top.frames['framename'].goUp()">
and it works so, but now I have two new problems:
1. This way I can not scroll but the page1.html, but I want that button to do the same for all pages, nomatter which is loaded in iframe
2. Even if I parse a variable, I still have to load the pages in iframe each time when I want to go top, but I want just to scroll, not to reload the page
I tried with
<a href="#" onclick="top.frames['framename'].goUp();return false">
and with
<a href="javascript:void(top.frames['framename'].goUp();return true)">
but it looks like the event open a new, undefined page, instead of simply scrolling up the page that is at the moment loaded in iframe. Any ideea?
One parent with an iframe. In the iframe are calling, from menu, some pages. All those pages are long enough to need a button or something for client to be alble to go top of the page from a single click. I want to have that button on the parent page, but i want to scroll the pages in the iframe.
Now, I built a function, written in a JS file, SRC from each "child" pages:
function goUp(){
location.href="#toppage";
{
I want to call that function from within that button placed on the parent.
I tried with:
<a href="page1.html" target="farmename" onclick="top.frames['framename'].goUp()">
and it works so, but now I have two new problems:
1. This way I can not scroll but the page1.html, but I want that button to do the same for all pages, nomatter which is loaded in iframe
2. Even if I parse a variable, I still have to load the pages in iframe each time when I want to go top, but I want just to scroll, not to reload the page
I tried with
<a href="#" onclick="top.frames['framename'].goUp();return false">
and with
<a href="javascript:void(top.frames['framename'].goUp();return true)">
but it looks like the event open a new, undefined page, instead of simply scrolling up the page that is at the moment loaded in iframe. Any ideea?