Initially, I came across this Simple and effective dropdown login box
I upgraded the sign-up box.
Now, I have both Login and Sign up dropdown boxes, but there is an issue.
When I click on Login (to activate) and then on Sign up (to activate the second box), the login box does not deactivate; instead, both boxes remain open and activated.
I need a solution where activating one of them deactivates the other.
Here is the jQuery code snippet:
$(document).ready(function(){
$('#login-trigger').click(function(){
$(this).next('#login-content').slideToggle();
$(this).toggleClass('active');
if ($(this).hasClass('active'))
$(this).find('span').html('▲')
else
$(this).find('span').html('▼')
});
$('#registr-trigger').click(function(){
$(this).next('#registr-content').slideToggle();
$(this).toggleClass('active');
if ($(this).hasClass('active'))
$(this).find('span').html('▲')
else
$(this).find('span').html('▼')
});
});
Thank you and apologies for any language issues.
Here is an example demonstrating the current behavior: http://jsfiddle.net/ZcVCK/2/