if($(this).next().is(':hidden')) {
$('.job_box').removeClass('active').next().slideUp('slow');
$(this).toggleClass('active').next().slideDown('slow');
$(".downarrow", this).toggleClass( ".uparrow" );
}
else
{
$(this).toggleClass('active').next().slideUp('slow');
}
I have added an 'else' statement to your current 'if' statement to hide the content upon clicking the box again.
EDIT: Add this to your CSS file. This will rotate your arrow rather than using another image.
.arrow_rotate {
-webkit-transform: rotate(180deg);
-moz-transform: rotate(180deg);
-ms-transform: rotate(180deg);
-o-transform: rotate(180deg;
transform: rotate(180deg);
}
Update your JQuery:
$('.job_box').click(function() {
if($(this).next().is(':hidden')) {
$('.job_box').removeClass('active').next().slideUp('slow');
$(this).toggleClass('active').next().slideDown('slow');
$(".downarrow", this).addClass('arrow_rotate');
}
else
{
$(this).toggleClass('active').next().slideUp('slow');
$(".downarrow", this).removeClass('arrow_rotate');
}
This should now do as you require.