PJ6 wrote:
On doubleclick of a table cell, I want to pop up a menu just under it. Right
now I've only figured out how to get the cursor position, I'd like whatever
element that pops up to be directly under the cell... can't seem to get a
workable left or height value.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/1998/REC-html40-19980424/loose.dtd">
<html><head>
<style type="text/css">
td { position: relative }
td span { display: none; position: absolute; background: #ffc;
border:1px solid red; padding: 4px; margin-top: 4px;
white-space: nowrap;}
td.iepop span { margin-top: 20px; }
td:hover span, td.iepop span { display: block }
</style>
<script type="text/javascript">
function pop(what) {
what.className = what.className==''? 'iepop' : '' ;
}
function init() {
var T = document.getElementsByTagName('TD');
ie = !!document.getElementsByTagName
&& !!document.getElementsByTagName('*')
&& !!document.getElementsByTagName('*').length
&& document.getElementsByTagName('*')[0].tagName=='!';
if(ie)
for(var i=0;i<T.length;i++) {
T[i].onmouseover= function() {pop(this)};
T[i].onmouseout= function() {pop(this)};
}
}
onload=init;
</script>
</head><body>
<table width=200 border=1>
<tr>
<td width=50%> one
<span>This is a popup<br>to see what it is<br>possible with CSS
</span>
</td>
<td> two
<span>This is an other popup, once more to see<br>
what css can make possible
</span>
</td>
</tr>
</table>
</body>
</html>
--
Stephane Moriaux et son [moins] vieux Mac