I have two elements that should not be active at the same time, so when one switches, I disappear, but I would like to fade out the open element, and then bring the other. Is there a way to do this that is not a hack?
<script ="text/javascript">
$(function() {
$('#jlogin').click(function() {
$('#login').toggle('fast');
$('#reg').fadeOut('fast');
});
$('#jreg').click(function() {
$('#reg').toggle('fast');
$('#login').fadeOut('fast');
});
});
</script>
This is my current script.
source
share