Hi Mike, sorry but that isn't working either. Rather than a problem in attaching an event to an element either before of after it's been added to the DOM it looks like I'm having dificulties accessing some of jQuery's functions, since I'm always able to trigger an event to show me an alert(), but not so with native jQuery functions like $.ajaxStop() or $.unblockUI(). For example, this will work:
$.blockUI(message); cancel.click(function(){ alert("foo"); }); but this won't: $.blockUI(message); cancel.click($.unblockUI); It's frustrating, because I'm running out of ideas and I don't even know if this is a known issue with IE and BlockUI. Thanks, and all ideas welcome. Abel. On Jul 20, 3:47 pm, "Mike Alsup" <[EMAIL PROTECTED]> wrote: > 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.