How to detect scroll in modal bootstrap?

0

Follow my CSS code:

.modal-body {
  max-height: calc(100vh - 210px);
  overflow-y: auto;
}

Follow JS code:

$('.modal-body').on('scroll', function () {
    console.log('scroll y');
});

JS code is not working, is there any solution?

    
asked by anonymous 02.10.2017 / 20:50

1 answer

1

I found the solution:

$('#minhaModal').on('shown.bs.modal', function(e) {
  $('.modal-body').on('scroll', function() {
    console.log('scroll y');
  });
})
    
02.10.2017 / 21:26