abel,

Your event handler needs to be added *after* the elements have been
added to the DOM and since blockUI manipulates the DOM, you need to
add your click handler after you block.  So try something along these
lines:

$.blockUI(message);
cancel.click($.unblockUI);

Mike


On 7/20/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

Hi everyone.
I'm using blockUI for a project and can't get it to work properly
under IE 6 and 7 (yeah, I know what you guys thinking, me too).
The problem comes when I try to use the function $.unblockUI() when
certain events trigger, ie:

var cancel =
  $("<input type='button' value='cancel' />")
  .bind("click", function(){ $.unblockUI(); });

var message =
  $("<form>")
  .append("<input type='submit' value='Ok' />")
  .append(cancel);

// This is where I add functionality.
$(".myAnchor")
  .bind(
    "click",
    $.blockUI(message);

Everything goes swimingly and the modal form appear whenever I click
on "MyAnchor", but when I click on "Cancel" I can't get it to unblock
(it works on Firefox though, of course). I think I've tried
everything, like defining the cancel button through more rustic means
like so (ready to remember the early 2000's?):

var cancel =
  $("<input type='button' value='cancel' onclick=' $.unblockUI(); ' /
>")

but this won't work either (in IE 6 and 7). Oh! I also tried switching
from jQuery 1.3 to 1.1 since that's the version they use in the
official page for the plugin and it works under Internet Explorer, but
that didn't work either.
I was wondering if this is a known issue with IE and there's a way to
solve it.

Thanks and sorry for the long post.


Reply via email to