Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-12-2010, 11:53 PM   PM User | #1
j9sjam3
New to the CF scene

 
Join Date: Nov 2010
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
j9sjam3 is an unknown quantity at this point
Overlays, blocking UI and un-blocking UI

This code works when the page is loaded, but doesn't work on the AJAX Post call back.
Code:
$(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();
		blockUI();
		$.ajax({
			type: "POST",
			url: "processor.php",
			data: "id=login&user="+user+"&pass="+pass,
			success: function(msg){
				unblockUI();
				$('#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.

Cheers.
j9sjam3 is offline   Reply With Quote
Old 11-13-2010, 12:06 AM   PM User | #2
j9sjam3
New to the CF scene

 
Join Date: Nov 2010
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
j9sjam3 is an unknown quantity at this point
Solved it myself.
Needed to place code in different places.
j9sjam3 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:54 AM.


Advertisement
Log in to turn off these ads.