jQuery BlockUi Message after another
Asked Answered
J

2

5

I'm using jQuery BlockUI plugin, and i have been able to sucessfully show a single message in the page, however... let's say that I want to show 3 messages , one after another.

Something like:

  1. message: 'hello world!'
  2. message: 'hello galaxy!'
  3. message: 'hello universe!'

how do I do this with jQuery BlockUI?

Judi answered 8/1, 2010 at 12:58 Comment(2)
when r u unblocking them ? is it block "hello world" unblock "hello world" block " galaxy" unblock " galaxy" .... or block "hello" block "galaxy" block "universe" unblock in LIFO/FIFO order ?Canebrake
It's in FIFO, and it's block 'hello world'. unblock, block 'hello galaxy', unblock, block 'hello universe', unblockJudi
W
13

Just create a div in your page like this:

<div id="blockMessage"></div>

And for the script...

$.blockUI({ message: $('#blockMessage') });
$("#blockMessage").html('Hello World!');
$("#blockMessage").html('Hello Galaxy!');
$("#blockMessage").html('Hello Universe!);
$.unblockUI();

This goes by very fast, but you get the idea....bonus here is you can style it to look however you want as well, e.g.:

#blockMessage { font-weight: bold; }
Williamwilliams answered 10/1, 2010 at 16:59 Comment(0)
C
3

This does not work when you have some callback function is being called on onBlock or onUnBlock, for example like this:

$.blockUI({ message : 'your new message', onBlock : callbackFunction });

An alternative to this would be, just call blockUI again with a different message:

$.blockUI({ message: 'New message' });

Comply answered 28/11, 2012 at 8:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.