Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8100873
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T22:51:13+00:00 2026-06-05T22:51:13+00:00

I have one query. Through while loop I am displaying three random songs from

  • 0

I have one query. Through while loop I am displaying three random songs from database and displaying them but I don’t want to display all three.

When users click on the first song play icon it starts playing and after it finishes first song it automatically goes to second song and after second song completes it goes to third song.

But I want to display only one block which is playing for example first block will be displayed and when users click on first it will start playing but when first completes it should scroll up and second song which is playing should be visible to visitor.

Here is my php code:

$res6411 = sql_query("SELECT * from `".tb()."stories` where app='music' order by rand() desc limit 3");
while($row6411 = sql_fetch_array($res6411)) {
    $outputmusic .= ' <div id="playlist"> <div href="'.$row6411['var1'].'" style="width: 520px;" class="item">
        <div>
            <div class="fr duration"></div>
            <div class="btn play"></div>
            <div class="title">'.$row6411['title'].'</div>
        </div>
        <div class="player inactive"></div>
    </div>        </div>

here is css

b{color:#555;font-weight:bold}.duration{font-size:10px;color:#777}.btn.play{width:16px;height:17px;background-image:url(i/play.gif);display:inline-block}.btn.pause{width:16px;height:17px;background-image:url(i/pause.gif?2)}.btn.paused{width:16px;height:17px;background-image:url(i/play.gif?3);display:inline-block}div.player{width:520px;height:14px;margin-top:5px;padding-left:20px}div.player.inactive{margin-top:0px;margin-bottom:0;border-top:dashed 0px #555}.item .title{-vertical-align:middle}.item .btn{display:inline;float:left;margin-right:5px;cursor:pointer}

Here is output from firebug.

It displays three blocks. I want to display only playing song and when first song finishes playing it automatically goes to second that time first should scroll up and second song should display

<div id="playlist" class="playlist1"> <div class="item" style="width: 520px;" href="uploads/userfiles/201206/1110_27_aslha.[Songs.PK]Blue-05-BlueTheme.mp3">
        <div>
            <div class="fr duration"></div>
            <div class="btn play"></div>
            <div class="title">Blue Theme</div>
        </div>
        <div class="player inactive"></div>
    </div><div class="item current" style="width: 520px;" href="uploads/userfiles/201206/110_48_7jngc.ChaleChalo.mp3">
        <div>
            <div class="fr duration"></div>
            <div class="btn pause"></div>
            <div class="title">Chale Chalo</div>
        </div>
        <div class="player"><embed width="380" height="5" flashvars="url=uploads/userfiles/201206/110_48_7jngc.ChaleChalo.mp3&amp;id=playlist1&amp;backgroundColor=16777215&amp;volumeBarWidth=40&amp;progressBarWidth=320&amp;barSpace=20&amp;volumeBarColor=5592405&amp;volumeBarHeight=1&amp;volumeSliderWidth=10&amp;volumeSliderHeight=5&amp;volumeSliderColor=5592405&amp;progressBarHeight=1&amp;progressSliderWidth=10&amp;progressSliderHeight=5&amp;progressSliderColor=5592405&amp;progressBarColor=10066329&amp;bufferColor=5592405" allowscriptaccess="sameDomain" swliveconnect="true" quality="high" name="playerplaylist1" id="playerplaylist1" style="undefined" src="swf/drplayer.swf" type="application/x-shockwave-flash" wmode="transparent"></div>
    </div><div class="item" style="width: 520px;" href="uploads/userfiles/201206/117_49_6l7ag.01KahonaKaho-AmirJama.mp3">
        <div>
            <div class="fr duration"></div>
            <div class="btn play"></div>
            <div class="title">Kaho na Kaho - murder</div>
        </div>
        <div class="player inactive"></div>
    </div></div>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T22:51:14+00:00Added an answer on June 5, 2026 at 10:51 pm

    It seems you’re already setting a “current” css class on the currently playing item. You can leverage this by just animating the divs based on this class. If you want all inactive items to be invisible, do something like this.

    In your CSS:

    .item{display:none;}
    

    In your jquery:

    //When doc is ready

    $(function(){
        $('.item').slideUp();
        $('.item.current').slideDown(); 
    });
    

    //You can set a speed/duration for this animation. See more info here: http://api.jquery.com/slideDown/

    Make sure you reference jquery in your head as well. You can link to this from Google: https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have one sql query as - SELECT name_1, dpid_clid, city FROM dts_master_dividend WHERE
I have one main array which is the returned data from a MySQL query
I used to have one function to any select query in my script, but
I have a while loop that goes through a table and I echo the
I have one query. It is executing fine on Hive CLI and returning the
I have one query on which I would like to get your valuable feedback.
In Delphi 4, we have one SELECT query which is fetching 3 Text type
I have one demo application to check select for update query public class Test
I have a question: Does it possible to collect multiple query in one query?
I have the following two queries which I want to get in one query.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.