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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T21:13:09+00:00 2026-05-23T21:13:09+00:00

On this site testsite , I’m making a numbers game for ESL students. It

  • 0

On this site testsite, I’m making a numbers game for ESL students. It uses a flash and a html5 audio player depending on browser (The plugin for somereason uses flash for firefox, but that’s not really important). There are 16 audio tracks. The flash player divs are #f-ONE, #f-TWO etc, while the html5 are #ONE, #TWO etc.

All the audio players are hidden on page load, and then (using the working code from this fiddle http://jsfiddle.net/andrewwhitaker/9BcUP/) when you click the start button, one number from an array of 16 is selected and assigned to variable ran and then either #f- is added if it’s flash or # is added if html5 and then one of the audio players is supposed to show. ran.show(): but it doesn’t work.

For debugging, I put in some console.log(ran) and it shows that the random element from the array is selected and then the div # is being added, but for someone reason the audio player is not showing.

Can you help me figure out why?

  • 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-23T21:13:10+00:00Added an answer on May 23, 2026 at 9:13 pm

    I noticed that your markup is:

    <audio controls="" autobuffer="" id="SIX" class="html5audio">
        <source src="http://eslangel.com/wp-content/uploads/2011/07/six.mp3" type="audio/mpeg">
        <object type="application/x-shockwave-flash" name="f-SIX" style="outline-style: none; outline-width: initial; outline-color: initial; visibility: visible; " data="http://eslangel.com/wp-content/plugins/degradable-html5-audio-and-video/incl/player.swf" width="290" height="24" id="f-SIX"><param name="wmode" value="opaque"><param name="menu" value="false"><param name="flashvars" value="initialvolume=80&amp;soundFile=http://eslangel.com/wp-content/uploads/2011/07/six.mp3&amp;playerID=f-SIX"></object>
        <script type="text/javascript">AudioPlayer.embed("f-SIX", {soundFile: "http://eslangel.com/wp-content/uploads/2011/07/six.mp3"});</script>
    </audio>
    

    Note that the element with id='f-SIX' is inside the element with id='SIX'. This means that when you hide elements with id="NUM", the element with id='F-NUM' is also hidden. Showing the inner element will not cause it to show up because the parent element is hidden (at least this appears to be the case for Google Chrome)

    Additionally, you have to think about browsers for which only the elements with id='f-SIX' are going to show up. This occurs because the audio tag is not supported in some browsers yet, therefore just the object tag will show up.

    I would change your JavaScript as follows:

    $(".start").click(function() {
    
        var ran = getRandom(myArray, true);
        if ($('#ONE').length) { 
            ran = $('#' + ran);
            ran.show();
    
        } else {
            ran = $('#f-' + ran);
            ran.css('display', 'block');
        }
    });
    

    Also note the use of display:block instead of .show(). The only reason for this is because I couldn’t get the object tag to play nice with .show() (any advice on this appreciated).

    For anyone reading, please read the entire chat transcript to see how I came about this answer.

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

Sidebar

Related Questions

This site is pretty good but I'm wondering what other resources are out there.
This site has a technique to pass xml data around in Microsoft SQL Server:
From this site: http://www.toymaker.info/Games/html/vertex_shaders.html We have the following code snippet: // transformations provided by
Like this site Pay attention to your address bar.
for this site: http://yoursdproperty.com/ do you see how there some extra white space all
Got this site with UN/PW set via the Createuserwizard control. Client considers PW too
On this site if you do too many clicks or post comments too fast
This is my first time on this site and I appreciate any help on
I know this site is written using ASP.Net MVC and I do not see
Like many others on this site I am considering a move to ASP.NET MVC

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.