Terence
04-17-2003, 09:19 AM
have a problem when making msg box.
The msgs are generated by "for loop".
if the user did not read the msg, the color of the row will be different (highlighted) from others.
now, i try to make an effect that the row color will be changed from white to lightgrey when the mouse pointer is moving over the row.
but the problem is the row color of a new msg will also change to white color when the pointer out of the row.
The new msg is not shown with the highlighted color again.
here is my code. can u help me?
...
<script language="javascript">
function over_bg (obj) {
obj.style.background="#E6E6E6";
}
function out_bg (obj) {
obj.style.background="";
}
</script>
....
<? for ($i = $no; $i > 0 ; $i--) { ?>
<tr onMouseOver="over_bg(this)" onMouseOut="out_bg(this)" <? If ($arr[$i][sstatus] == "new") { echo "style=\"background:#CECEFF\""; } ?>>
<td width="4%" height="25" align="center">
<input name="del[<?=$i?>]" type="checkbox" id="del[<?=$i?>]" value="<?=$arr[$i][msg_no]?>" <? If ($check == "all") { echo "checked"; }?>>
</td>
<td width="24%" align="left">
<a href="../member/member.php?user_no=<?=$arr[$i][receiver]?>">
<?=$arr[$i][nickname]?>
</a>ˇ@</td>
<td width="44%" align="left">
<a href="sent_msg.php?msgid=<?=$i?>">
<?=$arr[$i][title]?>
</a>ˇ@</td>
<td width="28%" align="left">
<? list($post_date, $time) = split( '[ ]', $arr[$i][post_date]);
echo $post_date;?>
ˇ@</td>
</tr>
<? } ?>
.......
The msgs are generated by "for loop".
if the user did not read the msg, the color of the row will be different (highlighted) from others.
now, i try to make an effect that the row color will be changed from white to lightgrey when the mouse pointer is moving over the row.
but the problem is the row color of a new msg will also change to white color when the pointer out of the row.
The new msg is not shown with the highlighted color again.
here is my code. can u help me?
...
<script language="javascript">
function over_bg (obj) {
obj.style.background="#E6E6E6";
}
function out_bg (obj) {
obj.style.background="";
}
</script>
....
<? for ($i = $no; $i > 0 ; $i--) { ?>
<tr onMouseOver="over_bg(this)" onMouseOut="out_bg(this)" <? If ($arr[$i][sstatus] == "new") { echo "style=\"background:#CECEFF\""; } ?>>
<td width="4%" height="25" align="center">
<input name="del[<?=$i?>]" type="checkbox" id="del[<?=$i?>]" value="<?=$arr[$i][msg_no]?>" <? If ($check == "all") { echo "checked"; }?>>
</td>
<td width="24%" align="left">
<a href="../member/member.php?user_no=<?=$arr[$i][receiver]?>">
<?=$arr[$i][nickname]?>
</a>ˇ@</td>
<td width="44%" align="left">
<a href="sent_msg.php?msgid=<?=$i?>">
<?=$arr[$i][title]?>
</a>ˇ@</td>
<td width="28%" align="left">
<? list($post_date, $time) = split( '[ ]', $arr[$i][post_date]);
echo $post_date;?>
ˇ@</td>
</tr>
<? } ?>
.......