Hide and Show the Login Block Update
Since writing the post on hiding and showing the login block, I've done some work on the site's theme and the on the jQuery code. The basic info applies, but I found that this jQuery code seems to work more consistently across browsers, particularly IE. Here it is:
function loginPopup(){
$('#popup').toggle('slow');
if($('a.popLogin').text() == 'Cancel'){
$('a.popLogin').text('Login');
}else{
$('a.popLogin').text('Cancel');
$('#popup').css('display', 'inline');
}
if($('a.popLogin').text() == 'Login'){
$('#messages').css('display', 'none');
}
return false;
}
$('#popup').toggle('slow');
if($('a.popLogin').text() == 'Cancel'){
$('a.popLogin').text('Login');
}else{
$('a.popLogin').text('Cancel');
$('#popup').css('display', 'inline');
}
if($('a.popLogin').text() == 'Login'){
$('#messages').css('display', 'none');
}
return false;
}
Instead of binding a click event as in the earlier version, this time it's simply toggling it's state whether it's displayed or not.