When you call $.unblockUI()
try calling it on an element instead, eg. $('html').unblock();
:
<div class="body">
<div id="message" style="display:none;">
<img src="logo.png" border="0" />
<br />
<h1>Welcome!</h1>
You may not view this page unless you are 21 or over.
<br />
<button id="over">I am 21 or over</button>
<button id="under">Under 21</button>
</div>
It's dusty under here! Let me be seen!
</div>
The JS would be:
$('.body').block({
message: $('#message'),
centerX: true,
centerY: true,
css: {
width: '600px',
height: '300px',
border: '3px solid #FF9900',
backgroundColor: '#000',
color: '#fff',
padding: '25px'
}
});
$('#over').click(function () {
alert('clicked!');
$('.body').unblock();
return false;
});
$('#under').click(function () {
$('.body').unblock();
return false;
});
See working example: http://jsfiddle.net/amyamy86/Taw83/
Read more about Element Blocking here: http://www.malsup.com/jquery/block/#element