Ok, I found a script that works, but I honestly have no clue what the javascript is doing.
Could someone more or less summarize what the javascript says in english?
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<style type="text/css">
<!--
#mydiv{
background-color: #999999;
height: 100px;
width: 100px;
display:none;
}
-->
</style>
<script type="text/javascript">
document.onclick=check;
function check(e){
var target = (e && e.target) || (event && event.srcElement);
var obj = document.getElementById('mydiv');
var obj2 = document.getElementById('sho');
checkParent(target)?obj.style.display='none':null;
target==obj2?obj.style.display='block':null;
}
function checkParent(t){
while(t.parentNode){
if(t==document.getElementById('mydiv')){
return false
}
t=t.parentNode
}
return true
}
</script>
</head>
<body>
<span id="sho" style="cursor:pointer">show the div</span>
<div id="mydiv">
<table width="50" border="0" cellpadding="2" cellspacing="1" bgcolor="#99FFCC">
<tr>
<td>we</td>
<td>e</td>
</tr>
<tr>
<td>rtr</td>
<td>rty</td>
</tr>
</table>
</div>
</body>
</html>
Gracias.
Bryan
Bookmarks