2

I am using jQuery BlockUI Plugin and I am having issues with firefox as blocking an element fires scroll event on that element and in my case I have other actions bind to element scroll and mess up my app logic.

Steps to Reproduce: Firefox Only 50+

  1. scroll div to end
  2. Press block-ui button to block element
  3. see console , div was scrolled
  4. unblocking element also causes scroll event

What I need : I want to avoid scroll event fired when element is blocked or unblocked. This only happens with firefox. WHY ??

JSFIDDLE: https://jsfiddle.net/bababalcksheep/1nv6znLg/36/

// print on scroll
$('#scroll-div').on('scroll', function(event) {
  console.log('div scrolled');
});
//block
$('#btn-block').click(function(e) {
  e.preventDefault();
  $('#scroll-div').block({
    'message': 'loading ...'
  });
});
//unblock
$('#btn-unblock').click(function(e) {
  e.preventDefault();
  $('#scroll-div').unblock();
});

Preview: enter image description here

django
  • 2,809
  • 5
  • 47
  • 80

0 Answers0