Gidon
Gidon

Reputation: 3490

Fire event onScroll using tinyscrollbar.js

I would like to fire an event every time I scroll using tinyscrollbar. I've tried using jquery's scroll method but it only works on areas outside of the tinyscrollbar section. Does anybody know how to do this?

Thanks

Upvotes: 0

Views: 1410

Answers (2)

Gidon
Gidon

Reputation: 3490

Found it, in tinyscrollbar.js line 167 "function wheel( event )"

Upvotes: 0

msapkal
msapkal

Reputation: 8346

You can bind the following events.

$("#scrollbar").on('mouseup', '.track', function() {
    console.log('scroll');
});

$("#scrollbar").on('mousewheel DOMMouseScroll', function() {
    console.log('mousewheel');
});

Upvotes: 1

Related Questions