FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

Row Rollover

 


kirii
Quote:
<!-- TWO STEPS TO INSTALL ROW ROLLOVER:

1. Copy the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document -->

<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->

<HEAD>

<style type="text/css">
<!--
#demo tr.ruled {
background:#9cf;
}
-->
</style>

<script type="text/javascript">
<!--
/* This script and many more are available free online at
::http://nguoithuongoi.info::*/

function tableruler() {
if (document.getElementById && document.createTextNode) {
var tables=document.getElementsByTagName('table');
for (var i=0;i<tables.length;i++)
{
if(tables[i].className=='ruler') {
var trs=tables[i].getElementsByTagName('tr');
for(var j=0;j<trs.length;j++)
{
if(trs[j].parentNode.nodeName=='TBODY') {
trs[j].onmouseover=function(){this.className='ruled';ret urn false}
trs[j].onmouseout=function(){this.className='';return false}
}
}
}
}
}
}
window.onload=function(){tableruler();}
// -->
</script>
</HEAD>

<!-- STEP TWO: Copy this code into the BODY of your HTML document -->

<BODY>

<table id="demo" class="ruler" summary="Table of my records" cellpadding="5">
<caption>Blues Artists & Songs</caption>
<thead>
<tr>
<th scope="col">Artist</th>
<th scope="col">Title</th>
</tr>
</thead>
<tbody>
<tr>
<td>John Mayall </td>
<td>Double Crossing Time </td>
</tr>
<tr>
<td>Buddy Guy </td>
<td>On A Saturday Night </td>
</tr>
<tr>
<td>John Lee Hooker </td>
<td>Don't Look Back </td>
</tr>
<tr>
<td>Bo Diddley </td>
<td>You Can't Judge a Book by Its Cover </td>
</tr>
<tr>
<td>Billie Holiday </td>
<td>Solitude </td>
</tr>
<tr>
<td>Stevie Ray Vaughan </td>
<td>Texas Flood </td>
</tr>
</tbody>
</table>

<p><center>
<font face="arial, helvetica" size"-2">NTO<br>
by <a href="http://nguoithuongoi.info">Tran Minh Tam</a></font>
</center><p>

<!-- Script Size: 2.68 KB -->

Use this script to highlight rows in tables. Short but effective.
have fun.!
Kelvin
I don't see anything on your given script. I just displays the words in the table you created. Nothing else. No special effect on mouseover. Does it work for anyone else?
Arno v. Lumig
Why not use this?

Code:


tr
{
background-color: #ffffff;
color: #00000;
}

tr:hover
{
 background-color: #000000;
color: #ffffff;
}

Reply to topic    Frihost Forum Index -> Scripting -> Html, CSS and Javascript

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.