I've some problem when I want to scroll after postback with asp.net.
if I try like this, it doesn't work but when I add an alert(posYDoc)
before $(window).scrollTop(yPosDoc)
in EndRequestHandler
it's working perfectly and position in alert is ok.
var yPosDoc;
var prm = Sys.WebForms.PageRequestManager.getInstance();
prm.add_beginRequest(BeginRequestHandler);
prm.add_endRequest(EndRequestHandler);
function BeginRequestHandler(sender, args) {
yPosDoc = $(window).scrollTop();
}
function EndRequestHandler(sender, args) {
$(window).scrollTop(yPosDoc);
}
Anyone can help me ? Thank you !