Open kkaplita opened 6 years ago
You could also manage your own collection of instances as you create them.
I would also be interested in this feature. Some libraries create the scrollbar themselves, so we cannot control, for example, the options. :slightly_frowning_face:
It can be something like:
$el.data("jq.PerfectScrollbar")
Or something like:
$el.PerfectScrollbar
I would also enjoy a way to override the options, especially the "handlers", but if I have the instance, I can always destroy and create another.
Bump .. I have the same requirement for this
I'm using JQuery, and i've been able to solve this using the JQuery caching feature.
const ps = new PerfectScrollbar(elementName,
{
wheelSpeed: 0.2,
swipeEasing: true,
wheelPropagation: propagateScrolling,
minScrollbarLength: 20,
maxScrollbarLength: 150
});
// Store the Perfect Scrollbar Instance for later
$(elementName).data("ps-" + elementName, ps);
Then in my "update" method, I just fetch the instance from the cache and call ".update" like this
var ps = $(elementName).data("ps-" + elementName);
if (ps !== null) {
ps.update();
}
@DarkCompiled - I dont think it'll help with your problem of not being able to get to instances created by third parties though..
We have the same requirement, but this issue is open for a long time. Is it not going to happen?
I would like to get instances of PerfectScrollbar by select element. In my project perfect scrollbar is initialized in many views and I want to get all instances in mainView to update etc.