I *know* everyone hates using tables but forgive me for doing so.
I've got a table laid out on screen like a calendar and I'd like it so that when someone clicks a particular day, an 'earmark' image moves to the top-left corner of the cell which has been clicked.
This is what I've done but it doesn't work:
The code doesn't give an error but neither does it move the image. Am I doing something impossible or just plain going about it the wrong way?
- Andy
___________________________________________________________________
If you think nobody cares you're alive, try missing a couple of mortgage payments
I've got a table laid out on screen like a calendar and I'd like it so that when someone clicks a particular day, an 'earmark' image moves to the top-left corner of the cell which has been clicked.
This is what I've done but it doesn't work:
Code:
<style>
img.marker { position: relative; }
</style>
<table><tr><td id='cell1'>
<img class='marker' id='marker'>
</td><td id='cell2'></td><td id='cell3'> ... lots more cells and rows ...
</td></tr></table>
In my Javascript code:
document.getElementById('marker').style.left = document.getElementById('cell'+thisoffset).style.left;
document.getElementById('marker').style.top = document.getElementById('cell'+thisoffset).style.top;
where thisoffset is the number of a cell.
The code doesn't give an error but neither does it move the image. Am I doing something impossible or just plain going about it the wrong way?
- Andy
___________________________________________________________________
If you think nobody cares you're alive, try missing a couple of mortgage payments