Open and Close div

by Patrick Kershner

HTML

<a href="#" id="contactus">Contact Us</a>
<div id="contactdiv"><span class="closespan"><a href="#"><img src="http://www.mywaterfilters.com/images/smallx.gif" alt="Close"></a></span>Test Content</div>

CSS

#contactdiv{
    top:51px;
    display:none;
    border:1px solid black;
    width:500px;
    height:300px;
}
.closespan:first-child{
float:right;
}

JavaScript

$( "#contactus" ).click(function() {
$( "#contactdiv" ).show( "slow", function(){
  });
});
$( ".closespan" ).click(function() {
$( "#contactdiv" ).hide( "fast", function(){
  });
    });