Thursday, January 21, 2010

jquery blockUI bug with internet explorer

When using jquery plugin blockUI if the user doesn't move the mouse after the control returns the cursor will continue to spin.
This is documented on the following post:
Here is the fix.
Edit the jquery.blockUI.js file
After line 379 add the line below.
Line 379: els = $('.blockUI', el);
Add this line: els[1].style.cursor = 'default';

It depends on what version of blockUI.js you have, but here is what I ended up using around line 390.

 var els;
 if (full) // crazy selector to handle odd field errors in ie6/7
  els = $('body').children().filter('.blockUI').add('body > .blockUI');
 else
  els = $('.blockUI', el);
  if ($.browser.msie && els[1] !== undefined) {
   els[1].style.cursor = 'default';
  }

4 comments:

  1. Hello
    just checked this solution: I always get
    els.length = 0
    when I put a breakpoint at line 380.

    therefore I cannot get into the condition's inner part and the cannot change the overlay's style.

    ReplyDelete
  2. Hello
    I have tried out the solution you suggest and here is what I came up with:

    when stopping the script at line 380 I get
    els.length = 0
    and therefore cannot apply the style to the overlay.

    Any further ideas?

    Thanks, Amos

    ReplyDelete
  3. Hello
    I try to use this solution but it does not work. When I stop the debugger at line 380 I see that els is empty (length 0). Any further idea?

    Thanks for the help
    Amos

    ReplyDelete
  4. The same problem with Google Chrome ! Any solutions?

    ReplyDelete