Jump to content
  • 0

iframe not scrolling to the top


Andrew
 Share

Question

I have an iframe where 1 datapage connects to another datapage

The first datapage has a iframe width="100%' height="3500"

when I am far down in the frame of the first page and click on a link to the 2nd page the 2nd page never starts at the top of the iframe window but way down in the middle/bottom

I know this is a common issue with iframes and have reviewed multiple solutions but none of the following work.  any help is greatly appreciated

 

none of the below works:

onload="window.top.scrollTo(0,0);
onload="window.parent.scrollTo(0,0);
onload="window.parent.parent.scrollTo(0,0);
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0
On 8/29/2021 at 12:44 AM, Andrew said:

I have an iframe where 1 datapage connects to another datapage

The first datapage has a iframe width="100%' height="3500"

when I am far down in the frame of the first page and click on a link to the 2nd page the 2nd page never starts at the top of the iframe window but way down in the middle/bottom

I know this is a common issue with iframes and have reviewed multiple solutions but none of the following work.  any help is greatly appreciated

 

none of the below works:

onload="window.top.scrollTo(0,0);
onload="window.parent.scrollTo(0,0);
onload="window.parent.parent.scrollTo(0,0);

Can you elaborate? I cant replicate yours. I have iframe on an HTML block with link to 2nd datapage, and it goes back to the top when clicked

Link to comment
Share on other sites

  • 0

The iframe is the same frame for 1 datapage,  the details section of this datapage is what doesn't load to the top, it loads in the middle if the section before it is scrolled far down when the link is clicked.

I've hired a javascript/iframes "expert" from guru.com to look at the issue,  so far they haven't come up with something.

For reasons beyond understanding this app builder tool (lumavate.com) I'm using to insert caspio into won't let the normal javascript embed syntax work correctly

so if iframes are a mess I'm trying to come up with a work around,  I've coded this and the page pulls up but its not dynamic,  its static and none of the links work that are in the caspio datapage

e.

I'm going to have my javascript developer look and see if they can figure this out and if they can then I don't have to worry about my iframes problem.

hopefully they smarter than I am with Javascript.

var script = document.createElement('script');
script.type = 'text/javascript';
script.src = "https://c2acm484.caspio.com/dp/8e82a000890b4e1dc20c4bf6a92c/emb";
document.head.appendChild(script)
 
 
 
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...