Help with on Blue() fadeOut, code not working

Hi,

I have the following JS code, which slides in one of 2 hidden divs on click, and when you click them or the button the divs fade out.

I want to replicate the fadeOut on Blur too, but that part of my code isnt working for some reason.

Im a bit of a noob when it comes to JS, still learning. So any help would be muc apprecited

CODE:


$(document).ready(function(){
$(".btn-ncl").toggle(function(){

//Open info
$(".info-ncl").stop().animate({ down: "+=1200" }, 600)
$(".info-ncl").stop().slideDown("slow");
}, function(){

//Close info
$(".info-ncl").stop().animate({ down: "-=300" }, 1400)
$(".info-ncl").stop().fadeOut("slow");
});


$(".btn-gh").toggle(function(){

//Open info
$(".info-gh").stop().animate({ down: "+=1200" }, 600)
$(".info-gh").stop().slideDown("slow");
}, function(){

//Close info
$(".info-gh").stop().animate({ down: "-=300" }, 1400)
$(".info-gh").stop().fadeOut("slow");
});


$(".info-gh").blur(function(){
alert('blur');
$(".info-gh").stop().animate({ down: "-=300" }, 1400)
$(".info-gh").stop().fadeOut("slow");
});

}); 

Oh really? thank you for your reply, I appreciate that.

Well if you cant ‘blur’ when clicking off the div, how can it be set so that the div fades out (hides again) once the user clicks elsewhere on the page?

Can anyone else shed some light on this?

I’m not very good with js but i don’t think javascript can handle focus event (blur on jquery) for elements like divs. The event is only for links and inputs. hope i’m wrong, because i’ve tried some while ago to accomplish something like that and I haven’t succed