Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Nov 2005
    Posts
    93
    Thanks
    5
    Thanked 0 Times in 0 Posts

    How to change table colors.

    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.

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,863
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    Sorry, too hard to guess your markup and the event handlers. Can we have a link?
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    New Coder
    Join Date
    Nov 2005
    Posts
    93
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Code for generating the first list 30 songs

    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.




    Code:
    <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>


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •