Solved

Music Pause button turns off animated gifs too??

Posted on 2004-08-05
18
2,647 Views
Last Modified: 2013-11-19
Greetings.
I installed a button to turn off background sound on my index page, which was a php issue.  However, we uncovered that the same button would also turn off the animated gifs on the page. Can someone explain how to get around this?

Please see question# 21080905 on php experts page.  

I have  background looping music  via:       <bgsound id='BGSOUND_ID' src="Sounds/fever.mid" loop="-1">
Button added:           <a href="javascript: void(0);" onClick="document.all['BGSOUND_ID'].src='silence.mid'">STOP Music</a>

Music is silenced...but......gifs are flattened too....

????
0
Comment
Question by:Steve_Newbie
  • 8
  • 7
  • 2
18 Comments
 
LVL 63

Expert Comment

by:Zvonko
Comment Utility
Like this:

<a href="javascript: void(0);" onClick="document.all['BGSOUND_ID'].src='silence.mid';return false">STOP Music</a>
0
 

Author Comment

by:Steve_Newbie
Comment Utility
Thanks. I incorporated your suggestion. However, since last night I have also modified the file structure a little to make it more template friendly.  I am using a PHP intermediary file so there was a slight modification to your script as follows :

 $_page_cont[0]['pause_music'] = "<a href=\"javascript: void(0); onClick=(document.all['BGSOUND_ID'].src='silence.mid);return false\">". _t("_pause music")."</a>";

The first part which resides on the html template file calls for the second href section of the code which is on the php file and the text is called from a separate lang file.

This stops the music also, but still knocks out the animated gif.  I don't think so, but do any of the modifications I had to use above to change the html/php file structure  influence this? or......I need a different solution.

Thanks for your help.

Steve
0
 
LVL 63

Expert Comment

by:Zvonko
Comment Utility
You have several syntax problems in the generated html resulting code.
Try this version:

$_page_cont[0]['pause_music'] = "<a href=\"javascript:void(0)\" onClick=\"document.all.BGSOUND_ID.src='silence.mid';return false\">". _t("_pause music")."</a>";

0
 

Author Comment

by:Steve_Newbie
Comment Utility
Thanks again, but unfortunately,even with the corrected syntx suggestions, still stops the animated gifs cold.  

?

Steve
0
 
LVL 63

Expert Comment

by:Zvonko
Comment Utility
Copy the resulting html code from browser html source here for analyzis, please.
0
 

Author Comment

by:Steve_Newbie
Comment Utility
If it stays on or goes off, the source is the same on the page.  The image of the main header gif is as noted below "NaughtyLifestyles.gif"
The MARQUEE is unaffected.  The other gifs that are affected also have a link set to them, so, guessing that that has something to do with it?
 

<table width=100% cellpadding=4 cellspacing=0>

    <tr>

        <td><a href="/"><img border=0 src="images/NaughtyLifestyles.gif" width="450" height="100"></a><p>&nbsp;

<MARQUEE behavior =scroll direction=left loop="25" scrollamount="6" scrolldelay="50" align="left"><font color="#CC3300" size="+2" face="cursive"><strong>Let

              your senses explore your inhibitions........</strong></font></MARQUEE></p></td>
0
 
LVL 63

Expert Comment

by:Zvonko
Comment Utility
Sorry, I did not state. I wanted to see the resulting html of the link with BGSOUND_ID.src assignment.
0
 

Author Comment

by:Steve_Newbie
Comment Utility
Before and after the button is toggled:

<!--<bgsound src="Sounds/fever.mid" loop="-1">  -->
    <bgsound id=['BGSOUND_ID'] src="Sounds/fever.mid" loop="-1">
      <script language="JavaScript">


Steve
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 63

Expert Comment

by:Zvonko
Comment Utility
I mean the line produced by this template:
$_page_cont[0]['pause_music'] = "<a href=\"javascript:void(0)\" onClick=\"document.all.BGSOUND_ID.src='silence.mid';return false\">". _t("_pause music")."</a>";

And is it a problem to post the browser source from a complette page?


0
 

Author Comment

by:Steve_Newbie
Comment Utility
Hi.
I thought that was the line....but again, I am not a programmer, so sorry if I'm not on top of this.  No, no problem.  Here is the complete page source after the button is toggled.   Sorry, a little loose since still under construction...



<html>

<head>
<TITLE>Naughty Lifestyles..open minded couples,swingers,enjoying alternative lifestyles. </TITLE>

 <!--   <title>NaughtyLifestyles</title>  -->

    <link href="styles_mcl.css" rel=stylesheet type=text/css>

    <script src="inc/js/functions.js" type="text/javascript" language="javascript"></script>

      <!--<bgsound src="Sounds/fever.mid" loop="-1">  -->
    <bgsound id=['BGSOUND_ID'] src="Sounds/fever.mid" loop="-1">
      <script language="JavaScript">

<!--

function FP_swapImg() {//v1.0

 var doc=document,args=arguments,elm,n; doc.$imgSwaps=new Array(); for(n=2; n<args.length;

 n+=2) { elm=FP_getObjectByID(args[n]); if(elm) { doc.$imgSwaps[doc.$imgSwaps.length]=elm;

 elm.$src=elm.src; elm.src=args[n+1]; } }

}



function FP_preloadImgs() {//v1.0

 var d=document,a=arguments; if(!d.FP_imgs) d.FP_imgs=new Array();

 for(var i=0; i<a.length; i++) { d.FP_imgs[i]=new Image; d.FP_imgs[i].src=a[i]; }

}



function FP_getObjectByID(id,o) {//v1.0

 var c,el,els,f,m,n; if(!o)o=document; if(o.getElementById) el=o.getElementById(id);

 else if(o.layers) c=o.layers; else if(o.all) el=o.all[id]; if(el) return el;

 if(o.id==id || o.name==id) return o; if(o.childNodes) c=o.childNodes; if(c)

 for(n=0; n<c.length; n++) { el=FP_getObjectByID(id,c[n]); if(el) return el; }

 f=o.forms; if(f) for(n=0; n<f.length; n++) { els=f[n].elements;

 for(m=0; m<els.length; m++){ el=FP_getObjectByID(id,els[n]); if(el) return el; } }

 return null;

}

// -->

</script>

      

    <script language="JavaScript"><!--

    tmi_rate=new Image;

    tmi_rate.src = "images_mcl/menu_rate_photos2.gif";

    tmi_online_chat=new Image;

    tmi_online_chat.src = "images_mcl/menu_online_chat2.gif";

    tmi_invite_friend=new Image;

    tmi_invite_friend.src = "images_mcl/menu_invite_friend2.gif";

    tmi_affiliates=new Image;

    tmi_affiliates.src = "images_mcl/menu_affiliates2.gif";

    tmi_terms_of_use=new Image;

    tmi_terms_of_use.src = "images_mcl/menu_terms_of_use2.gif";

    tmi_privacy=new Image;

    tmi_privacy.src = "images_mcl/menu_privacy2.gif";

    tmi_faq_and_help=new Image;

    tmi_faq_and_help.src = "images_mcl/menu_faq_and_help2.gif";

    tmi_articles=new Image;

    tmi_articles.src = "images_mcl/menu_articles2.gif";

    tmi_feedback=new Image;

    tmi_feedback.src = "images_mcl/menu_feedback2.gif";

    tmi_about_us=new Image;

    tmi_about_us.src = "images_mcl/menu_about_us2.gif";

    tmi_links=new Image;

    tmi_links.src = "images_mcl/menu_links2.gif";

    tmi_contacts=new Image;

    tmi_contacts.src = "images_mcl/menu_contacts2.gif";

    --></script>







<body bgcolor=000000 topmargin=0 rightmargin=0 leftmargin=0 onload="FP_preloadImgs(/*url*/'Older%20or%20non-used%20files/button87.jpg', /*url*/'Older%20or%20non-used%20files/button86.jpg')">





<table width=100% valign=top border=0 cellpadding=0 cellspacing=0>

<tr>

<td colspan=3>

    <table width=100% cellpadding=4 cellspacing=0>

    <tr>

        <td><a href="/"><img border=0 src="images/NaughtyLifestyles.gif" width="450" height="100"></a><p>&nbsp;

<MARQUEE behavior =scroll direction=left loop="25" scrollamount="6" scrolldelay="50" align="left"><font color="#CC3300" size="+2" face="cursive"><strong>Let

              your senses explore your inhibitions........</strong></font></MARQUEE></p></td>

<!-- [BEGIN] Top page Menu -->



      <td bgcolor=000000 align=right width=100>



      <table cellpadding=0 cellspacing=0>



            <tr>
              <td height="7" align=right> <a href=rate.php><img name=img00 border=0 src="images_mcl/menu_rate_photos.gif" onMouseOver="javascript:img00.src='images_mcl/menu_rate_photos2.gif';" onMouseOut="javascript:img00.src='images_mcl/menu_rate_photos.gif';" height=6></a></td>
            </tr>

            <tr><td><img border=0 src="images_mcl/spacer.gif" height=10></td></tr>


            <tr><td><img border=0 src="images_mcl/spacer.gif" height=10></td></tr>



            <tr><td align=right>

            <a href="javascript: void(0);" onClick="return launchTellFriend();"><img name=img02 onMouseOver="javascript:img02.src='images_mcl/menu_invite_friend2.gif';" onMouseOut="javascript:img02.src='images_mcl/menu_invite_friend.gif';" border=0 src="images_mcl/menu_invite_friend.gif" height=6></a></td></tr>



      </table>                        



      </td>

      <td bgcolor=000025 align=right width=100>



      <table cellpadding=0 cellspacing=0>

            <tr><td align=right>

            <a href="affiliates.php"><img alt="affiliates" name=img03 onMouseOver="javascript:img03.src='images_mcl/menu_affiliates2.gif';" onMouseOut="javascript:img03.src='images_mcl/menu_affiliates.gif';" border=0 src=images_mcl/menu_affiliates.gif height=6></a></td></tr>



            <tr><td><img border=0 src=images_mcl/spacer.gif height=10></td></tr>



            <tr><td align=right>

            <a href="terms_of_use.php"><img alt="terms of use" name=img04 onMouseOver="javascript:img04.src='images_mcl/menu_terms_of_use2.gif';" onMouseOut="javascript:img04.src='images_mcl/menu_terms_of_use.gif';" border=0 src=images_mcl/menu_terms_of_use.gif height=6></a></td></tr>



            <tr><td><img border=0 src=images_mcl/spacer.gif height=10></td></tr>



            <tr><td align=right height="7">

            <a href="privacy.php"><img alt="privacy" name=img05 onMouseOver="javascript:img05.src='images_mcl/menu_privacy2.gif';" onMouseOut="javascript:img05.src='images_mcl/menu_privacy.gif';" border=0 src=images_mcl/menu_privacy.gif height=6></a></td></tr>

      </table>



      </td>

      <td bgcolor=000035 align=right width=100>



      <table cellpadding=0 cellspacing=0>



            <tr><td align=right>

            <a href="faq.php"><img alt="faq and help" name=img06 onMouseOver="javascript:img06.src='images_mcl/menu_faq_and_help2.gif';" onMouseOut="javascript:img06.src='images_mcl/menu_faq_and_help.gif';" border=0 src=images_mcl/menu_faq_and_help.gif height=6></a></td></tr>



            <tr><td align=right><img border=0 src=images_mcl/spacer.gif height=10></td></tr>



            <tr><td align=right>

            <a href="articles/articles.php"><img alt="articles" name=img07 onMouseOver="javascript:img07.src='images_mcl/menu_articles2.gif';" onMouseOut="javascript:img07.src='images_mcl/menu_articles.gif';" border=0 src=images_mcl/menu_articles.gif height=6></a></td></tr>



            <tr><td align=right><img border=0 src=images_mcl/spacer.gif height=10></td></tr>



            <tr><td align=right>

            <a href="stories.php"><img alt="feedback" name=img08 onMouseOver="javascript:img08.src='images_mcl/menu_feedback2.gif';" onMouseOut="javascript:img08.src='images_mcl/menu_feedback.gif';" border=0 src=images_mcl/menu_feedback.gif height=6></a></td></tr>

      </table>



      </td>

    <td bgcolor=000045 align=right width=100>



      <table cellpadding=0 cellspacing=0>



                  <tr><td align=right>

                  <a href="about_us.php"><img alt="about us" name=img09 onMouseOver="javascript:img09.src='images_mcl/menu_about_us2.gif';" onMouseOut="javascript:img09.src='images_mcl/menu_about_us.gif';" border=0 src=images_mcl/menu_about_us.gif height=6></a><br></td></tr>



                  <tr><td align=right><img border=0 src=images_mcl/spacer.gif height=10><br></td></tr>



                  <tr><td align=right>

                  <a href="Links/index.html"><img alt="links" name=img10 onMouseOver="javascript:img10.src='images_mcl/menu_links2.gif';" onMouseOut="javascript:img10.src='images_mcl/menu_links.gif';" border=0 src=images_mcl/menu_links.gif height=6></a><br></td></tr>



                  <tr><td align=right><img border=0 src=images_mcl/spacer.gif height=10><br></td></tr>



                  <tr><td align=right>

                  <a href="contact.php"><img alt="contacts" name=img11 onMouseOver="javascript:img11.src='images_mcl/menu_contacts2.gif';" onMouseOut="javascript:img11.src='images_mcl/menu_contacts.gif';" border=0 src=images_mcl/menu_contacts.gif height=6></a></td></tr>



      </table>





<!-- [END] Top page Menu -->



        </tr>

    </table>



<tr>

    <td background="images_mcl/plank_fill_1.gif" height=22 width="33%">

        <table cellpadding=0 cellspacing=0 border=0 width=100% class=text>

            <tr>



                <td><img src="images_mcl/spacer.gif" width=3></td>

                <td nowrap><img src="images_mcl/plank_item.gif" width=17 height=22></td>

                <td nowrap class=menu_top><b><a class=menu_top href="http://www.naughtylifestyles.com/member.php">Member Login</a></b>&nbsp;&nbsp;</td>

                <td nowrap><img src="images_mcl/plank_item.gif" width=17 height=22></td>

                <td nowrap class=menu_top><b><a class=menu_top href="http://www.naughtylifestyles.com/join_form.php">Free Sign Up</a></b>&nbsp;&nbsp;</td>
                        
                        <td nowrap><img src="images_mcl/plank_item.gif" width=17 height=22></td>

                <td nowrap class=menu_top><b><a href="javascript:void(0)" onClick="document.all.BGSOUND_ID.src='silence.mid';return false"><font color=red>Pause Music </font></a></b>&nbsp;&nbsp;</td>

                        
                        

               <!-- SV commented out the search on INDEX page <td nowrap><img src="images_mcl/plank_item.gif" width=17 height=22></td>

                <td nowrap class=menu_top><b><a class=menu_top href="http://www.naughtylifestyles.com/member.php">Search Profiles</a></b>&nbsp;&nbsp;</td>  -->



            </tr>

        </table>

    </td>

    <td background="images_mcl/plank_fill_2.gif" width="1%"><img src=images_mcl/plank_center.gif width="20" height="22"></td>

    <td background="images_mcl/plank_fill_2.gif" height=22 width="41%" valign=middle>

            <table class=text cellspacing=0 cellpadding=0 width=100%>

        <td width=50% align=right> &nbsp;&nbsp;&nbsp;</td>

        </table>

        </td>



</tr>



<table height=329 width=100% bgcolor=FFFFFF  bordercolor=#FF3300>

<colgroup span="1"></colgroup>

<colgroup span="1"></colgroup>

<colgroup span="1"></colgroup>

<tr><th width="300">



             

                        <img border="0" src="images_mcl/sexygirl.jpg" width="350" height="329">

</th>

             

                        <th>

                        <table border=0 class=it cellspacing=3 cellpadding=0 align=left>

                            <tr><td>

                                    <img src=images_mcl/spacer.gif width=1 height=54></td>

                                          

                         <!--   <tr><td width=19 height=19>

                                                <img src=images_mcl/pin.gif width=19 height=19></td>

                                          <td width=100%>

                                                <i><b>__homepage_promo0__</b></i><TD>&nbsp;

                                                </td>

                                          </TD></tr>  -->   <!-- SAV commented out contest....LATER-->

                            <tr><td width=19 height=19>

                                                <img src=images_mcl/pin.gif width=19 height=19></td>

                                          <td width=100%>

                                                <i><b><font color=red><b>FREE</b></font> <i>Lifetime Charter Membership</i>....start meeting naughty new friends now!</b></i></td>

                                          </tr>

                            <tr><td width=19 height=19>

                                                <img src=images_mcl/pin.gif width=19 height=19></td>

                                          <td width=100%>

                                                <i><b><b>FREE</b> personal profile on a friendly, upscale site</b></i></td>

                                          </tr>

                            <tr><td width=19 height=19>

                                                <img src=images_mcl/pin.gif width=19 height=19></td>

                                          <td width=100%><i><b><b>EASY</b> to post photos, voice, and video</b></i></td>

                                          </tr>

                           <tr><td width=19 height=19>

                                                <img src=images_mcl/pin.gif width=19 height=19></td>

                                          <td width=100%><i><b><b>EASY</b> to use Flash IM and Chat features</b></i></td>

                                          </tr>

                                          <!--<tr><td width=19 height=19>

                                                <img src=images_mcl/pin.gif width=19 height=19></td>

                                          <td width=100%><i><b><b>FREE</b> NaughtyNewsletter...great topics and tips!</b></i></td>

                                          </tr> -->

                            <tr><td width=19 height=19>

                                                <img src=images_mcl/pin.gif width=19 height=19></td>

                                          <td width=100%><i><b>Full  FORUM.  Discuss everything naughty!</b></i></td>

                                          </tr>

                            <tr><td width=19 height=19>

                                                <img src=images_mcl/pin.gif width=19 height=19></td>

                                          <td width=100%><i><b>Advanced matching system for best fit in naughty interests.</b></i></td>

                                          </tr>



                                          </th>

 

                    </table>

                       

                        <th width="356">

                        <a href=join_form.php><img src=images_mcl/ani-join.gif width=60 height=20 border=0></a><table>

                            <tr>



                    <td width="39%">

                              <img src=images/Meetfeaturedcouples.gif width=306 height=35><p>

                                    <tr><td width='100' bgcolor=white align=center><a href='http://www.naughtylifestyles.com/profile.php?ID=4'><img  alt='TahitiCpl : A sexy secure couple looking for fun...' title='TahitiCpl : A sexy secure couple looking for fun...' border=0 src='http://www.naughtylifestyles.com/id_img/4_0_5.jpg'></a></td></tr><tr><td width='100' bgcolor=white align=center><a href='http://www.naughtylifestyles.com/profile.php?ID=3'><img  alt='NaughtyAdmin : Your naughty administrators' title='NaughtyAdmin : Your naughty administrators' border=0 src='http://www.naughtylifestyles.com/id_img/3_0_8.jpg'></a></td></tr>   </p>



      

      </td> </tr>
     </table>
  </td>
</tr>
<tr></tr>

<!--SV lower black table in the index page -->
<TABLE width="100%" height="100%" bgcolor=000000> </TABLE>



<tr> <td>
  <table align="center" border="0" width="670" style="border: 1 solid #C0C0C0" cellspacing="0" cellpadding="0">
 
      <td align="center" style="padding: 5">

<b><i><font face="Arial" size="2" color="#FF0000">WARNING:</font></i><font face="Arial" size="2" color="#FFFFFF"> This

Naughty Lifestyles&nbsp; website contains

adult materials</font></b><font size="1" face="Arial" color="#CCCCCC"><br>

Members have certified that all pictures submitted are of individuals 18

years of age or older and all primary producers&nbsp;have certified that they

have complied with 28 C.F.R. 75&nbsp;thereby exempting NaughtyLifestyles&nbsp; from record keeping requirements of 18 U.S.C. 2257(a)--(d).&quot;<br>
You MAY NOT enter or view the contents of this website unless you are at least 18 years of age (21 years of age
in AL,MS,NE,WY, and any other geographic location or state where 18 is not the legal age of majority and/or where viewing such materials is
prohibited by law.)</font>

</td>

    </tr>



  </center>

</div>

</body>

</html>




0
 
LVL 63

Expert Comment

by:Zvonko
Comment Utility
Sorry, I do not support "naughty" sites.
0
 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 50 total points
Comment Utility
The return false on the link takes care of the animated gif.
You however now have added an error to the page
 <bgsound id=['BGSOUND_ID'] src="Sounds/fever.mid" loop="-1">

should be
 <bgsound id="BGSOUND_ID" src="Sounds/fever.mid" loop="-1">

without the square brackets

I would personally do
<a href="#"
onClick="if (document.all) document.all.BGSOUND_ID.src='silence.mid';
return false">

so it would work in all browsers

Michel
0
 

Author Comment

by:Steve_Newbie
Comment Utility
Thanks for that solutions.  Works perfectly!!  Also, I appreciate the comment re: all browsers. At the moment, it is optimized for IE overall.....but would like to have a wider installed base so that  more potential users  may  have access.  

Thanks.
Steve
0
 
LVL 75

Expert Comment

by:Michel Plungjan
Comment Utility
No problems...
If you have more things you need to have done and need direct help with pages that are not to be posted at this site, feel free to look in my profile :)
0
 
LVL 63

Expert Comment

by:Zvonko
Comment Utility
Thanks Michel for helping out and thank you Netminder for understanding.
0
 

Author Comment

by:Steve_Newbie
Comment Utility
And thanks Zvonko for your initial help..   Understand.  Just trying to get these code issues resolved, and eventually hopefully help at least a little on this forum if I learn enough.
Thanks.
S
0
 
LVL 63

Expert Comment

by:Zvonko
Comment Utility
You are welcome.
And my problems with your site have in no way an intention to offend you.
As stated, it is only my attitude.

See you,
Zvonko
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now