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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T21:10:25+00:00 2026-05-29T21:10:25+00:00

Whenever .startb is clicked, my player does not appear. I used this exact method

  • 0

Whenever .startb is clicked, my player does not appear. I used this exact method to dynamically add in flash audio players on click, but it does not seem to work with html5 audio players..nothing appears.

html

<div class="audioContainer">
            <div class="audioTitle">my title</div>
            <div class="playerHolder">
            <div class="htmlPlayer" id="player1"></div>
            <div class="startb" id="startb2" ><img src="dbs/images/start.png" width="40" height="40" /></div>
            <div class="flashObj" id="test2"></div>
            <div class="mp3Logo"><a href="Audio/music.mp3"><img src="dbs/images/mp3_off.gif"/></a></div>
            </div>
</div>

js

$(".startb").css({"display":"inline-block"});
$(".flashObj").css({"display":"none"});
$(".htmlPlayer").css({"display":"none"});
$(".mp3Logo").css({"display":"none"});
$('.startb').click(function() {
    htmlPlayerId = $(this).siblings('.htmlPlayer').attr('id');
    startbId = $(this).attr("id");
    musicLink = $(this).siblings('.mp3Logo').find('a').attr('href');
    htmlLayout = '<audio class="AudioPlayerV1" preload="none" width="292">'+
                 '<source src="'+musicLink+'" type="audio/mpeg" />'+
                 '</audio>'
    $('#'+startbId).css({"display":"none"});
    $('#'+htmlPlayerId).append(htmlLayout);
    $('#'+htmlPlayerId).css({"display":"inline-block"});

});
  • 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-29T21:10:26+00:00Added an answer on May 29, 2026 at 9:10 pm

    You can optimize your script a lot:

    $(".startb").css({"display":"inline-block"});
    $(".flashObj, .htmlPlayer, .mp3Logo").css({"display":"none"});
    $('.startb').click(function() {
        var htmlLayout = '<audio class="AudioPlayerV1" preload="none" width="292">'+
                         '<source src="' + $(this).siblings('.mp3Logo').find('a').attr('href') + '" type="audio/mpeg" />'+
                         '</audio>'
        $(this).css({"display":"none"})
               .siblings('.htmlPlayer').append(htmlLayout).css({"display":"inline-block"});
    });
    

    Update

    Since you are using a plugin to load your audio files (AudioPlayerV1), you should initialize your <audio> elements with the plugin:

    $(".startb").css({"display":"inline-block"});
    $(".flashObj, .htmlPlayer, .mp3Logo").css({"display":"none"});
    $('.startb').click(function() {
        var htmlLayout = '<audio preload="none" width="292">'+
                         '<source src="' + $(this).siblings('.mp3Logo').find('a').attr('href') + '" type="audio/mpeg" />'+
                         '</audio>'
        $(this).css({"display":"none"})
               .siblings('.htmlPlayer').append(htmlLayout).css({"display":"inline-block"});
        $(this).siblings('.htmlPlayer').children('audio').AudioPlayerV1();
    });
    

    Source: http://1.s3.envato.com/files/14653378/index.html#options (click on the “API METHODS” link)

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

Sidebar

Related Questions

Whenever I start my app, I get a java.lang.IllegalArgumentException: column '_id' does not exist
Whenever I try to add a new project to my SourceSafe repository it creates
I am trying to use Selenium RC but i keep getting this error whenever
I have a simple Tab Navigation with jquery. Whenever a new tab is clicked,
I went through and had the program System.exit(0) whenever the user clicked the window's
I have a rails app and get this warning whenever I start the server
Whenever I start a new project in Flex builder I always have to go
Whenever I start a shell in vim using :sh, it doesn't source my ~/.bashrc
The screen which shows whenever i start Netbeans is very annoying, and among the
Scenario I've created a windows service, but whenever I start it, it stops immediately.

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.