Implement Background Music with Pause/Play Icon in JQuery/Javascript

Posted by Amnesiac11 on Stack Overflow See other posts from Stack Overflow or by Amnesiac11
Published on 2012-04-06T15:08:16Z Indexed on 2012/04/06 17:29 UTC
Read the original article Hit count: 149

Filed under:
|

Hello and thank you in advance. I'm quite newto JQuery/Javascript and am unsure how to implement my embedded background music with my pause/play icons. Any help would be greatly appreciated. Thanks in advance!

       <div id="toggle" class="play" style="width: 314px; height: 311px"></div>
       <script type="text/javascript"></script>



     $(document).ready(function() {
       $('#music').attr("class", "false");
        $('#toggle').bind("click", function() {

        if ($(this).attr("class") == "play")

        $(this).attr("class", "pause");


        else
        $(this).attr("class", "play");


        });

        });

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery