Link to finished example
http://cabbit.co.uk/login/
I have been playing with making a script that pops down a login panel while pushing the site down and placing a overlay over the content.
However i am struggling and needing a little help with changing the link button to make it close if it as already open.
So far i have tried adding a class of open to the link then trying to use that as a separate action for closing but this has not worked.
http://cabbit.co.uk/login/
I have been playing with making a script that pops down a login panel while pushing the site down and placing a overlay over the content.
However i am struggling and needing a little help with changing the link button to make it close if it as already open.
Code:
$(document).ready(function(){
var height = $('#login').height();
$('#login').hide().css({ height : 0 });
$('a[rel=login]').click(function() {
$('#login').animate({ height : height }, {queue: false, duration: 700, easing: 'backEaseOut', complete: function() {
$("#overlay:hidden").show();
$('a[rel=login]').addClass("open");
}});
});
So far i have tried adding a class of open to the link then trying to use that as a separate action for closing but this has not worked.
Last edited: