scrollIntoView() within an iframe

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • knkk
    New Member
    • Jun 2007
    • 49

    scrollIntoView() within an iframe

    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.di vID.scrollIntoV iew() 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!
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Have you a link, or could you post some code?

    Note that document.all won't work in most browsers. Use document.getEle mentById() to reference an element.

    Comment

    Working...