My situation: there are three link buttons within fixed position div at the top of the page (title area). Each button needs to scroll to own anchor (those are in each repeater's record row, created programmatically with separate IDs, names, etc.) on a button click. Number of buttons is equal to the number of record rows. The page is "Show-table" type and loads different record sets of three records each.

One solution, which works OK is to set button's OnClientClick -

Code:

javascript:window.scrollTo(0,0);return false;

(that goes to the top of page),

or

Code:

javascript:window.scrollTo(0,y);return false;

(that scrolls y number of pixels from page's top)

The problem with above JS is that each record of different recordsets contains multiple panels with different amount of details' data and (therefore) different scroll length (or height in the scrollable area), which vary for the records from ~1000 to ~3000 px). Consequently, using the static y number does not give accurate scrolling.

When using (example)

Code:

javascript😃ocument.getElementById('MyAnchor3').scrollIntoView(true);

does not give any results on the button click.

So, I wonder if anyone has similar experience and/or is willing to indicate a potential direction towards some positive results.

Thanks in advance.

P.S. Commercial third party controls are out of requirementsP.P.S. Collapsible panels are not desirable as well (although could be the last resort)

Insert Photos

Web address (URL)

Image URL

If your URL is correct, you'll see an image preview here. Large images may take a few minutes to appear.
Remember: Using others' images on the web without their permission may be bad manners, or worse, copyright infringement.