2

I've a problem, why this work

$(selector).scroll(function(e) {
    console.log("Scrolling");
});

and this not

$(document).on("scroll", selector, function(e) {
    console.log("Scrolling");
});

This is selector

var selector = "#schedule td > div.k-scheduler-content, #schedule td > div.k-scheduler-header";

The scroll event by "on" not work... I don't know why... Check this plunker http://plnkr.co/edit/CjfoIPTCqScS1znAwmIs?p=preview

UPDATE

Maybe I found a solution that work:

document.addEventListener(
  'scroll',
  function(event){
    var $elm = $(event.target);
    if( $elm.is(selector) ) { // or any other filtering condition
      // do some stuff
      console.log('scrolling');
    } else {
      console.log("selector different");
    }
  },
  true // Capture event
);
Davide
  • 475
  • 4
  • 19

1 Answers1

0

Try to use it like following :

$("#test").on("scroll", function() {
    console.log("Scrolling");
});

Hope this helps.

Zakaria Acharki
  • 66,747
  • 15
  • 75
  • 101