PDA

View Full Version : Highlight row in Netscape



arnyinc
Jan 21st, 2003, 10:26 PM
Not sure if this is more java or css but...

I am trying to highlight a row based on an onmouseover in a <tr> in Netscape 4.76. Since Netscape doesn't directly allow this, I am trying to fake it with a layer outside a <tr>, but this causes bad behavior and all the formatting to be lost. Specifically the width=200 and second row get obliterated. Is this due to where I have the layer and ilayer defined?



<html>
<body>
<table>
<ilayer width="100%">
<layer width="100%" onMouseover="this.bgColor='yellow'" onMouseout="this.bgColor='white'">
<tr>
<td width="200">cell 1</td>
<td width="200">cell 2</td>
<td width="200">cell 3</td>
<td width="200">cell 4</td>
</tr>
</ilayer>
</layer>
<tr>
<td width="200">cell 5</td>
<td width="200">cell 6</td>
<td width="200">cell 7</td>
<td width="200">cell 8</td>
</tr>
</table>

</body>
</html>

Borgtex
Jan 22nd, 2003, 01:17 AM
Maybe you can put a layer inside every cell and then highlight all or try with the layer inside the <tr> tags... I don't know... but considering the marginal amount of people that still uses NS4, do you think that it is worth the trouble to waste time & efforts in that?

brothercake
Jan 22nd, 2003, 01:43 AM
I agree - you'd have to put the <ilayer><layer> arrangement inside each TD to make it works; if you gave them incremental IDs then you could setup all the event listeners in a for() loop.

But I also agree it's not worth it ... well not for production use anyway; if you have a historical interest in ns4's layer setup, then go for it :)

justame
Jan 22nd, 2003, 03:03 AM
arn...
/me has this just a copied/credited/saved® to change just a 'cell'® onmouseover...
mayyybe you can just a dapt® it to work for just a tr®???



WA posted 02-29-2000 05:26 PM
Well, what you could do is add an onMouseover code directly inside the <TABLE> in question, so to change it's background color on mouse over. For example:

<script>
function changecolor(thistable,color){
if (document.all)
thistable.style.backgroundColor=color
}
</script>

<table onMouseover="changecolor(this,'yellow')" onMouseout="changecolor(this,'')">
<tr><td>Test table</td></tr>
</table>

Just add the onMouseover code and script above and use it on your own table.

arnyinc
Jan 22nd, 2003, 02:02 PM
It looks like there's no easy way to take care of it, so I'll just leave it alone. For my specific case, this is an intranet site and there is a handful of people who have linux and UNIX workstations when they are on-site (they either can't or won't upgrade to IE). As long as the site "works" for them, they aren't allowed to complain though.

I appreciate the input. :)

Tails
Jan 24th, 2003, 07:58 PM
Maybe you can set an onMouseOver event on the TR tag of the row you want to do. That will ensure compatibility between IE and NS. If that doesn't work, I'm sure there's something you can do with ID tags and more JavaScript.

Bosko
Jan 24th, 2003, 10:22 PM
Originally posted by arnyinc
It looks like there's no easy way to take care of it, so I'll just leave it alone. For my specific case, this is an intranet site and there is a handful of people who have linux and UNIX workstations when they are on-site (they either can't or won't upgrade to IE). As long as the site "works" for them, they aren't allowed to complain though.

I appreciate the input. :)

Ehm,why don't they upgrade to Netscape 7 (or Mozilla 1.x)?Or maybe even Konqueror?

brothercake
Jan 25th, 2003, 05:47 AM
or Opera 6 - it comes in all kinds of obscure OS flavours

Bosko
Jan 25th, 2003, 01:39 PM
Originally posted by brothercake
or Opera 6 - it comes in all kinds of obscure OS flavours

Thats not really recommendable,since Opera 6 doesnt have much support for the DOM (version 7 does).