Slide down after a set time but when share button is clicked also slide up and down
Ok im new here, and new to jquery but i have done the following code, which is soposed to side down a div 5 seconds after the page has loaded and also when you click another div it slideds up and down. It slides down fine but when you come to click the "share" div to slide it up the first click doesn't register after that it works fine. Im sure it something completely stupid i have done. Help most appreciated thanks.
<script>
$(function(){
var socDrop = function () {
$('.socialS').addClass('active');
$('.socialS').slideDown("slow");
}
window.setTimeout(socDrop , 5000);
$('.share').click(function(){
if($(this).hasClass('active')){
$(this).removeClass('active');
$('.socialS').slideUp();
} else {
$('.socialS').slideDown();
$(this).addClass('active');
}
});
});
</script>