View Full Version : jQuery Overlays, blocking UI and un-blocking UI

11-13-2010, 12:53 AM
This code works when the page is loaded, but doesn't work on the AJAX Post call back.

$(document).ready(function() {
var H = $(window).height();
$('#footer').css('top', H -30);

$('#overlay').css('height', H).fadeTo('fast', 0.5);

jQuery.each(jQuery.browser, function(i, val) {
if(i!="mozilla" && jQuery.browser.version.substr(0,3)!="1.9") {
alert("WARNING: You are not using Firefox 3+. \nWe reccomend using Firefox 3+ for security, speed and compatibilty.");
return false;

$('#login2').click(function() {
$('#login2').attr('disabled', 'disabled');
var user = $('#username').val();
var pass = $('#password').val();
type: "POST",
url: "processor.php",
data: "id=login&user="+user+"&pass="+pass,
success: function(msg){
$('#login2').attr('disabled', '');
function blockUI() {
$('#overlay2').css('display', 'inline');
$('#overlay').css('display', 'inline');
$('#overlay').css('height', H).fadeTo('fast', 0.5);
function unblockUI() {
$('#overlay').css('display', 'none');
$('#overlay2').css('display', 'none');
$(window).load(function() {
var t=setTimeout("unblockUI()", 1000);

The callback is working, I tested it with an alert.
Like I said, the block UI and unblock UI work, hence the timer.

I have no idea what else there is to do now. Any help would be brilliant.


11-13-2010, 01:06 AM
Solved it myself.
Needed to place code in different places.