jquery - scroll the page to show div position of page after post back -
i using following jquery scroll page specified div position while clicking on linkbutton. using linkbuttons on top of page , want page navigate on specified div @ bottom of page.
$(function () { $('#<%=linkbtn1.clientid%>, #<%=linkbtn2.clientid%>, #<%=linkbtn3.clientid%>, #<%=linkbtn4.clientid%>').click(function () { $('html,body').animate({ scrolltop: $("#grddv").offset().top }, 800); }); return false; });
i using linkbutton events 4 linkbuttons below, performing suitable work.
protected void linkbtn1_click(object sender, eventargs e) { try { session["interval"] = 1; bindgrid(id); } catch (exception ex) { } }
the problem when linkbutton calls jquery scroll page required position, after that, when codebehind event called page goes server , when returns shows top position of page.
i want use linkbutton's click event in each case, please how show div available on bottom of page.
to restrict page show specified position on page after call back, used following script rather above script.
<script> var pagerequestmanager = sys.webforms.pagerequestmanager.getinstance(); pagerequestmanager.add_endrequest(function () { $('html,body').animate({ scrolltop: $("#grddv").offset().top }, 800); return false; }); </script>
Comments
Post a Comment