Monday, 15 August 2011

javascript - Set multiple scrollbar positions on EndRequest -


I have an ASP.Net page which posts so many times every time, so I have a solution to keep scrollbar posts I found a solution for the scrolling device on the page around that works for a single divas (first gets $ get with a jquery), but I have to do it every I am trying to try again to go through one.

  var xPos = []; Var yPos = []; Var prm = Sys.WebForms.PageRequestManager.getInstance (); Prm.add_beginRequest (BeginRequestHandler); Prm.add_endRequest (EndRequestHandler); Start the functionRextHandler (Sender, Args) {yPos = []; XPS = []; $ ('Tablecontainer') each (function (theIndex, element) {xPos [theIndex] = $ (this) .scrollLeft; yPos [theIndex] = $ (this) .scrollTop;}); } Function EndRequestHandler (Sender, Args) {$ ('tablecontainer'). Each (function (theIndex, element) {$ (this) .scrollLeft = xPos [theIndex]; $ (this) .scrollTop = yPos [theIndex];}); }  

Here I have so far earned, but it seems that it does not do the trick and I am not sure where it hangs. I put it in jsfiddle to make sure that there was no syntax errors I was missing, but I'm pretty sure where do not go from here.

Can someone provide some insight? It's been running for a while and then finally eliminates an indicator from a direct error; I think that at the beginning of the request handler, resetting the arrays will have to stop it at least.

After a little bit of tinkering, in this way I ended up resolving this issue. I realized the elements I was using were identical IDs, so I was walking through the classroom again.

  var xPos = [4]; Var yPos = [4]; Var prm = Sys.WebForms.PageRequestManager.getInstance (); Prm.add_beginRequest (BeginRequestHandler); Prm.add_endRequest (EndRequestHandler); Start the function (requestor, args) {$ ("Table Container"). Each (function (index, element) {xPos [theIndex] = $ (this) .scrollLeft; yPos [theIndex] = $ (this) .scrollTop;}); } Function EndRequestHandler (Sender, Args) {$ ("tablecontainer"). Each (function (theIndex, element) {$ (this) .scrollLeft = xPos [theIndex]; $ (this) .scrollTop = yPos [theIndex];}); }  

No comments:

Post a Comment