1

If I am scrolling my page and the update gets triggered by the timer the page/scrollposition slightly jumps/jitters/lags. I am using MaintainScrollPositionOnPostBackon my pages and it works fine if I am stationary somewhere on the page, no jump/jitter/lag on update then. Any ideas on how to fix it while scrolling too? Maybe pause the timer while scrolling if possible?

Skillzore
  • 748
  • 7
  • 21

2 Answers2

1

Found a solution over here. For lazy people:

<script type="text/javascript">
window.scrollTo = function( x,y ) 
{
    return true;
}
</script>

Just put this in your .aspx file.

Community
  • 1
  • 1
Skillzore
  • 748
  • 7
  • 21
0

There is workaround for that issue. You pass to controller element you had focus on and then on page load you focus back to that element.

Find focus:

var focusedElement = document.activeElement;

focusedElement you send to server (controller or whatever) via post/get or something.

Focus back on page load:

$(document).ready(function() {
    $("#" + recivedFocusedElement).focus();
}

recivedFocusedElement you recive from server.

  • What would `document` be here? My page is pretty simple, it is a table filled with server statuses. The table is placed in an updatepanel and that's about it. – Skillzore Jun 22 '16 at 11:28