...

View Full Version : How to change table colors.



coolguyraj
03-14-2009, 12:59 PM
Hi,

I have a master table list containing 30 songs and a "play" button at the bottom of the page.when i click on "play" button it should generate one more table containing 5 random songs from the master table above. each of these rows should be loaded dyanamically after the previous song is played.

As the song random song is played in the second list that same song should be highlighted in the first list dynamically.

How can i do this using javascript.

I have the first part of generating the list of 30 songs.How can i continue from there.

Plsaes help.

Thanks.

abduraooft
03-14-2009, 01:20 PM
Sorry, too hard to guess your markup and the event handlers. Can we have a link?

coolguyraj
03-14-2009, 01:45 PM
here is the php code that generates the first list of 30 songs.

from tis list i have to again pick 5. and they have to get loaded in sequence after the previous song is played.and as a new song is played the coresponding song will be available in the first table of 30 that song has to be highlighted. so for every song played in second list the corresponding song in first list has to be highlighted.





<TABLE width="100%" border="0" cellpadding="2" cellspacing="1" id="Table1">
<?php if (!empty($message)){?>
<tr class="tanbg">
<td colspan=10 align="center" nowrap><?php echo $message;?></td>
</tr>
<?php }?>
<?php if (empty($message)&&($records>0)&&(!empty($soundalikes))){?>
<tr class="tanbg">
<td colspan=10 align="center" nowrap><?php echo $soundalikes;?></td>
</tr>
<?php }?>
<tr bgcolor="#000000" class="topheaderbg">
<th class=whiteText>
<a href="<?php echo $_SERVER['file:///D|/recruit/Apache Group/Apache2/htdocs/recruit/PHP_SELF'];?>?orderby=first" style="text-decoration: none">

<font size="1" color="#FFFFFF" face="Verdana">Song Name</font></a></th>
<th class="bodyTextWhite">
<font face="Verdana" size="1" color="#FFFFFF">Song Description</font></th>
<th class="bodyTextWhite">
<font face="Verdana" size="1" color="#FFFFFF">Song Genre</font></th>
<th class="bodyTextWhite">
<font face="Verdana" size="1" color="#FFFFFF">Song Popularity</font></th>
<th class="bodyTextWhite">
<font face="Verdana" size="1" color="#FFFFFF">Singer Name</font></th>
<th class=whiteText><font size="1" color="#FFFFFF" face="Verdana">
Played Recently</font></th>
<th class=whiteText><font size="1" color="#FFFFFF" face="Verdana">
Album/Movie Name</font></th>
<th class=whiteText><font size="1" color="#FFFFFF" face="Verdana">
Action</font></th>


<?php/* echo $orderby*/?>

</tr> <?php
$i=0;
$bg="gainsboro";

while ($row=mysql_fetch_array($result)){
if ($bg=="gainsboro"){
$bg="lemonchiffon";
}else{
$bg="gainsboro";
}

?>

<tr height="25" onmouseover="this.style.backgroundColor='lightgreen';" onmouseout="this.style.backgroundColor='<?php echo $bg;?>';"bgcolor="<?php echo $bg;?>"class="<?php echo $bg;?>" onmouseover="this.className='highlightBG';" onmouseout="this.className='<?php echo $bg;?>';">
<td id="td_<?php echo $i;?>_a" class="bodytext10px" nowrap valign="middle" align="left" >
&nbsp;<font face="verdana" size="1"><?php echo ($row['1']);?></font></td>
<td id="td_<?php echo $i;?>_b" class="bodytext10px" nowrap valign="middle" align="center">
&nbsp;<font face="verdana" size="1"><?php echo ($row['2']);?></font></td>
<td id="td_<?php echo $i;?>_c" class="bodytext10px" nowrap valign="middle" align="left">
&nbsp;<font face="verdana" size="1"><?php echo ($row['3']);?></font></td>
<td id="td_0_d" class="bodytext10px" nowrap valign="middle" align="left">
&nbsp;<font face="verdana" size="1"><?php echo ($row['4']);?></font></td>
<td id="td_<?php echo $i;?>_e" class="bodytext10px" nowrap valign="middle" align="left">
&nbsp;<font face="verdana" size="1"><?php echo ($row['5']);?></font></td>
<td id="td_<?php echo $i;?>_f" class="bodytext10px" nowrap valign="middle" align="left">
&nbsp;<font face="verdana" size="1"><?php echo ($row['7']);?></font></td>

<td id="td_<?php echo $i;?>_f" class="bodytext10px" nowrap valign="middle" align="left">
&nbsp;<font face="verdana" size="1"><?php echo ($row['6']);?></font></td>



<td id="td_<?php echo $i;?>_f" class="bodytext10px" nowrap valign="middle" align="left">
&nbsp;<font face="verdana" size="1"><?php echo 'PLAY NOW';?></font></td>


</tr>
<?php
$i++;
}
?>
</table>

</td>
</tr>


</table>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum