asp.net user control scroolIntoView is scrolling entire page -


i there

i'm using asp.net user control tree view. when load page want scrool user control selected node in tree view. i'm using js function .scrollintoview(true). scrolling entire page (not inside user control)

here's code

//js function scrooltofirstselectedcheckbox(ctrlid) {      event.observe(window, 'load', function() {         var tree = document.getelementbyid(ctrlid + '_mytreeview');          var checkboxes = tree.getelementsbytagname("input");         var checkboxescount = checkboxes.length;         (var = 0; < checkboxescount; i++) {             if (checkboxes[i].checked) {                 checkboxes[i].scrollintoview(true);                 break;             }         }     }     ); }  //aspx.cs  page.clientscript.registerclientscriptblock(this.gettype(),                                               "scrolltoselectedcheckbox",                             string.format("scrooltofirstselectedcheckbox('{0}')",                             this.uniqueid),                             true); 

how can keep parent page scroll position continue set user controll position want?

tks

ok, changed

checkboxes[i].scrollintoview(true); 

with

checkboxes[i].scrollintoview(false); 

that's it!!!

=p


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

aspxgridview - Devexpress grid - header filter does not work if column is initially hidden -

c# - How to execute a particular part of code asynchronously in a class -