Using mCustomScrollbar on jQuery UI dialogs.
If I initiate mCsutomScrollbar on $(window).load as proposed on the mCsutomScrollbar instructions, it does not work because my dialogs are not visible at that point. So I have to initiate mCsutomScrollbar on the open event of the dialog.
open: function() {
$(this).mCustomScrollbar();
}
Which works except when I open the same dialog a second time mCustomScrollbar is initialized for a second time when it already is initialized and breaks. I can see the custom scrollbar but I cannot scroll.
So it seems I need a way to remove mCustomScrollbar on close or beforeclose event of the dialog. Not exactly sure how to do this.
turns out there is a built in function in mCustomScrollbar that does what I need
$('selector').mCustomScrollbar("destroy")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With