By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
463,008 Members | 613 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 463,008 IT Pros & Developers. It's quick & easy.

scrollIntoView() within an iframe

P: 49
I have an iframe within a page, and i want a div in that frame to scroll to the top of just that frame when a link is clicked upon (so only the page in that frame should scroll up/down, and not the mother page containing the iframe). However, document.all.divID.scrollIntoView() is scrolling the entire page in the window to the top so as to put the div at the top, and not just the page in the iframe.

So first the page in the iframe scrolls up/down to put the div at the top of that iframe, and then the mother page itself scrolls up/down so that the iframe is at the top of the window, with the div at the top of the iframe.

Can someone help me handle this? Thanks a lot in advance!
Oct 25 '08 #1
Share this Question
Share on Google+
1 Reply

Expert Mod 15k+
P: 16,027
Have you a link, or could you post some code?

Note that document.all won't work in most browsers. Use document.getElementById() to reference an element.
Oct 26 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.