The Lodge is members-only design/dev videos and Office Hours.

Next Office Hours Session: "Programming Fundamentals" Dec 02 - 2:00 PM Eastern

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

  • # September 27, 2009 at 6:16 am

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

    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:

    if (ie) {
    parent.spellbox.document.getElementById("h1").scrollIntoView(false); //works for IE only !!!?!??!
    //parent.spellbox.document.getElementById("h1").scrollIntoView(false); // does not work
    // 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.


Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

There's a whole bunch of content on CSS-Tricks.

Search for Stuff   •   Browse the Archives

Get the Newsletter ... or get the RSS feed