It does not mount the scroll bar on elements that are with "display: none". Does anyone know how to solve it?
It does not mount the scroll bar on elements that are with "display: none". Does anyone know how to solve it?
Put a handler on your elements for when they are displayed:
$('.elemento').each(function() {
if (!$(this).is(':visible')) {
return;
}
$(this).mCustomScrollbar({
scrollButtons: {
enable: true
}
});
});
The element can only be used by jQuery when the element is displayed: block or something similar, You could try to apply the custom Scrollbar as soon as the element is displayed.
Ask the question anyway: What action did you take to apply the custom scrollbar? "is in the click event of some element being displayed," then call the custom scrollbar assembly at the event.