I use the following in order scrolling to top.
How could i edit it so the top is set by a div tag?
var pageRequestManager = Sys.WebForms.PageRequestManager.getInstance();
pageRequestManager.add_endRequest(function() {
$('html, body').animate({ scrollTop: 0 }, 'slow');
});
You need to use
.offset()to get the correct position value like:.offsetreturns the current position of an element relative to the document.References: .position(), .offset()