Problem with "scroll" event

Problem with "scroll" event

Hello everyone!

I have problem with working scroll event. I wrote this code:
  1. $(document).on('scroll', '.dialog_box', function(){
  2. console.log('testing');
  3. });
And when I scroll this element nothing happens.

I use on method because originally there is no such element on the page.

By the way if instead of scroll event I use click event everything works perfectly.

Thanks a lot in advance for any help!