Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript JavaScript Gurus: Help with ScrollIntoView with NS/Moz vs. I

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #26261
    dreammama
    Member

    I’m working on a nice spellchecker for vB, posted at vb.org

    Within the spellcheck window, it uses an IFRAME, and I would like the window to scroll the contents to the highlighted word elemented (named hl).

    The following line:

    parent.ispellcheck.document.getElementById("h1").s crollIntoView(false);

    Works fine in IE, but doesn’t do much with Netscape/Mozilla/Firefox.

    Anyone knows the proper syntax to get scrollIntoView to work properly?

    I’ve tried several variatons in the (else) part below, to no avail:

    hilightWord();
    if (ie) {
    parent.spellbox.document.getElementById("h1").scrollIntoView(false); //works for IE only !!!?!??!
    }
    else
    {
    //parent.spellbox.document.getElementById("h1").scrollIntoView(false); // does not work
    document.spellbox.getElementById("hl").scrollIntoView(false);
    // does not work!!!
    }

    You can see the entire source, if it helps. I’m just hoping it’s an easy to spot problem for those familiar with how the different browsers want to call IFRAMEs.


    lortie

Viewing 1 post (of 1 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.