I need to bind to the on scroll event of a DataTable which is set to scroll vertically.
Its obvious that a simple event binding does not work.
$('table tbody').on('scroll', function() {
alert('');
});
I have created a demo here.
Does any one know an API method or work around that can do this?
It's not the table that's overflowing it's the parent div
$('.dataTables_scrollBody').on('scroll', function() {
alert('');
});
Demo: http://jsfiddle.net/SQ5RL/1/
Furthermore, I have never used this plugin So I don't know it's behavior. If the code above happens to not work, try the one below just in case.
$('table tbody').parent().on('scroll', function() {
alert('');
});
BTW, This is tested to work too.
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