I am using this tutorial to add a modal screen:
http://raventools.com/blog/create-a-modal-dialog-using-css-and-javascript/
Everything works great except clos
Try this:
$(document).ready(function(){
$('#overlay').bind('click', function(event){
if (event.target == $('#overlay').get(0))
overlay();
});
You will have to move the code of the the overlay from the modal window. Separating this, you will not have the overlay as a parent of the window and the click event will trigger only on the overlay.
<div id="overlay"> </div>
<div id="modalWindow">
<p>Content you want the user to see goes here.</p>
</div>