Código Javascript
:
Ver original<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
<script>
$( function (){
$('#id').click( function(){
$('#id2').slideToggle('fast');
});
$(document.body).click( function (evt){
if ( $("#id2").is(":visible") && evt.target.id != "id")
$('#id2').slideUp('fast');
});
});
</script>
<style>
#id2{height:30px; width:250px; background:red;}
</style>
</head>
<body>
<button id="id">Toggle</button>
<div id="id2"></div>
</body>
</html>