[jQuery] BlockUI - changing messages in a dialog

[jQuery] BlockUI - changing messages in a dialog


I'm using the blockUI plugin to block a div, and display a small confirmation
dialog, which is based on a hidden div (#question) on the page. That all
works.
If the user confirms the action by clicking a button, I want to display a
second div with a "data loading" sort of message & loading gif while the
ajax operation takes place (div#wait). I can't quite get this part to work
correctly... I know I've got the syntax wrong, but not sure how best to do
this... I can see the #wait div appearing briefly in the wrong place, in
addition to the original #question div...
based on the example from the demo page, I've put this together:
$(function() {
// cache the question element
var question = $('#question')[0];

$('a.filter').click(function() {
            $('#myDiv').block(question, { width: '275px' });
});

$('#yes').click(function() {
// update the block message
            $('#myDiv').block($('#wait'), {width: '275px'});

$.ajax({
url: 'wait.htm?' + new Date().getTime(), // prevent caching
in IE
complete: function() {
// unblock when remote call returns
                    $('#myDiv').unblock();
}
});
return false;
});

        $('#no').click(function() {
            $('#myDiv').unblock();
        });
});
Anybody? thanks!
--
View this message in context: http://www.nabble.com/BlockUI---changing-messages-in-a-dialog-tf3960765s15494.html#a11239773
Sent from the JQuery mailing list archive at Nabble.com.