I figured out a solution.
for slideToggle, all we need to do is put Update in a function and call it in switch mode. those. call the function when the switch is completed.
function updateScrollbar() { $('#rightFixed').mCustomScrollbar("update"); } $("#showTax").click(function () { $("#cartTaxDiv").slideToggle(updateScrollbar);
So, the Toggle problem is solved.
Transition to the second problem - GridView. When the GrodView is updated, the scroll bar should be updated. Therefore, for this, we must call this function at each postback. I do not use the update panel here, so I will call this function if postback in pageload.
if (IsPostBack) { Page.ClientScript.RegisterStartupScript(this.GetType(), "myscript", "updateScrollbar();", true); }
Consequently, the problems are resolved.
source share