I have a chat section fixed at the bottom of my website, it has a 'toggle' function, so it means it closes and open when the user hit the 'Chat support' button, what I want to do is to add the functionality that closes the chat even if you hit outside the button but I don't know how to do that.
I leave my js code below, it's just a simple toggle function, I hope you guys can help me with this, as you can see I'm really new in jQuery.
Code:
$('#ChatToggle').click(function(){
$('#ChatContainer').toggle('slow');
});
Thanks in advance.