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 4565768
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T18:41:27+00:00 2026-05-21T18:41:27+00:00

if you could help me out with this I would be really grateful! I

  • 0

if you could help me out with this I would be really grateful!

I have 10 small pieces of text. I’d like each to fade in and then out in sequence. As each piece of text reaches full opacity, I want a bell sound to play. Once all ten texts have displayed i’d like the last one to stop and remain static.

I’d also like that when the user moves the mouse or uses the keyboard for the message “start again” to appear and for the sequence of 10 messages to begin again.

Is this possible in jquery?

  • 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-05-21T18:41:28+00:00Added an answer on May 21, 2026 at 6:41 pm

    You can accomplish this easiest if you utilize the jQuery sound plugin and .fadeIn()

    Javascript:

    var loopRunning = false;
    $(document).ready(function() {
    
        loopRunning = true;
        // start the first fade in
        fadeInToSound(1);
    
        // bind to mousemove or keypress
        $(document).bind('mousemove keypress', function() {
            if(!loopRunning) {
                loopRunning = true;
                $("#container .hidden").hide();
                $("#startAgain").show();
                // start the fades over again
                fadeInToSound(1);
            }
        });
    
    });
    
    /**
     * Handles fading in a single div of text and, if the ID passed in is less
     * then ten, recurses to fade the next div in.
     * If the ID is greater than one, stops the last sound
     */
    function fadeInToSound(idNum) {
        // if this is not the first ID, stop the last sound
        if(idNum > 1) {
            $.fn.soundPlay({playerId: 'embed_player', command: 'stop'});
        }
        // fade in the div "text<idNum>"
        $("#text" + idNum).fadeIn(500, function() {
            // use the jQuery sound plugin to play the sound
            $.fn.soundPlay({url: 'music/bell.wav',
                playerId: 'embed_player',
                command: 'play'});
            // if this isn't the last ID, recurse to do the next one
            if(idNum < 10) {
                fadeInToSound(idNum + 1);
            } else {
                loopRunning = false;
                setTimeout("$.fn.soundPlay({playerId: 'embed_player', command: 'stop'});", 500);
            }
        });
    }
    

    HTML:

    <!-- The div to show the start again text -->
    <div id="startAgain" class="hidden">Start Again</div>
    <!-- The text divs -->
    <div id="container">
        <div id="text1" class="hidden">Text 1</div>
        <div id="text2" class="hidden">Text 2</div>
        <div id="text3" class="hidden">Text 3</div>
        <div id="text4" class="hidden">Text 4</div>
        <div id="text5" class="hidden">Text 5</div>
        <div id="text6" class="hidden">Text 6</div>
        <div id="text7" class="hidden">Text 7</div>
        <div id="text8" class="hidden">Text 8</div>
        <div id="text9" class="hidden">Text 9</div>
        <div id="text10" class="hidden">Text 10</div>
    </div>
    

    CSS:

    .hidden {
        display: none;
    }
    

    If your IDs are not of the form “text1”, then you can put them in an array to access or find some other logical way to increment your count.

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

Sidebar

Related Questions

I would be really grateful if somebody could help me out with this.. I
I would be very grateful if anyone could help me out with this problem.
I was wondering if any one could help me out; I have a table
I really hope someone will be able to help me out with this. I
i've seen many questions on NSDateformatter and NSDate, but none could help me out.
I wonder if someone could help me figure out how to parse a string
Ok so could anyone please help me out with the VB for auto entering
Could you please help me find out the time complexity of the Fleury' algorithm
I tried searching around, but I couldn't find anything that would help me out.
I hope someone could help me on this. I want to add a month

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.