jQuery mCustomScrollbar disappears after Ajax reload

耗尽温柔 提交于 2019-12-21 20:35:21

问题


like here written I have a problem with jQuery mCustomScrollbar. Binding the scrollbar at the first load works fine.

$("#contenDiv").load("dummytext.php", function() {
   $("#contenDiv").mCustomScrollbar({
        theme: "light",
        alwaysShowScrollbar: 1
      });
 });

But when I reload the Divs content the mCustomScrollbar disappears, althougt I call the "update" method.

$("#loadbutton").click(function() {
    $("#contenDiv").load("dummytext.php", function() {
        $(this).mCustomScrollbar("update");
    });
});

I've also been trying to work with on() and delegate() methods but they don't recognize the jquery Ajax load() event.

Can anyone help me?

来源:https://stackoverflow.com/questions/24632825/jquery-mcustomscrollbar-disappears-after-ajax-reload

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!