How to catch mousewheel up/down event using RaphaelJs

Posted by alex.dominte on Stack Overflow See other posts from Stack Overflow or by alex.dominte
Published on 2013-10-25T09:47:57Z Indexed on 2013/10/25 9:54 UTC
Read the original article Hit count: 319

Filed under:
|
|
|
|

I need to implement a horizontal scrollable timeline. I've drawn the timeline/grids/rulers etc. I just need to catch mousewheel up/down to scroll the timeline (backward - past/forward - future).

First I need to catch the event: but nothing I've found seems to work. Need browser support only for chrome/firefox (latest versions).

These 2 won't listeners won't work:

var paper = new Raphael('raphael-paper');
// ...
paper.canvas.on('mousewheel', function(event) {     
    console.log(event);
});
// ...
paper.canvas.addEventListener('mousewheel', function(event) {
    console.log(event);
});

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery