Window scrolling (clarification)

Giganews Newsgroups
Subject: Window scrolling (clarification)
Posted by:  elektrophy…@yahoo.com (Ethan)
Date: 2 Jul 2003

This is a clarification of a previous message, which was not expressed
very well. I have a set of checkboxes near the bottom of the page and
a function that checks or unchecks all of them. But when the function
runs, the window scrolls to the top of the page.

How can I set my checkboxes but leave the window's scroll position
exactly where it is? Or at least have it scroll to the bottom (where
the checkboxes are).

I've tried using window.scrollTo(), but the window always scrolls to
the top no matter what. It's the same in Navigator and IE.

Here's my code:

function checkAll(whichForm, startIndex, endIndex)
    {
        for (var j = startIndex; j <= endIndex; j++)
        {
            document.forms[whichForm].elements[j].checked = true;
        }
    window.scrollTo(0, 1000);
    }

Thanks,

Ethan

Replies