if and else statement check if has class
.toggleClass() is for this specific purpose
From the doc
Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument.
$('#accountloginsignup h1').click(function() {
$('#takeonebar').toggleClass('slamdown');
});
There is a typo
$('#accountloginsignup h1').click(function() {
if ($('#takeonebar').hasClass('slamdown')){
$('#takeonebar').removeClass('slamdown'); /* missing . before removeClass */
} else {
$('#takeonebar').addClass('slamdown');
}
});