Reputation: 1129
I have a div on which i have used mCustomScrollbar js library, now i need to get the scroll event of this div.
Can anyone help me on this ?
here is the code i have used to set mCustomScrollbar on div.
<div id="content"></div>
<script>
$('#content').mCustomScrollbar();
</script>
Upvotes: 1
Views: 1241
Reputation:
just use mcustomscrollebar library event of getting scroll event , you can see it on site.
Upvotes: 0
Reputation: 550
you can use MutationObserver
Following this code
var observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
console.log($(mutation.target).css('top'));
});
});
observer.observe(document.getElementById('mCSB_1_container'), { attributes : true, attributeFilter : ['style'] });
Here's a fiddle
Upvotes: 1