Avatar billede l34rn Nybegynder
01. marts 2007 - 00:06 Der er 1 løsning

Musik autostart virker ikke- nogen som kan kigge min html?

Hej alle herinde

Jeg har et lille problem med at få mit javascript til at starte automatisk. Selve afspilningen firker fint, dog skal man selv sætte det igang. Et andet problem er at når den første sang slutter skal man selv trykke på "næste" for at den fortsætter, hvordan automatiserer man dette?

på forhånd mange tak!

HTML----------------------

<HTML>
<HEAD>
<TITLE>top</TITLE>
</HEAD>

<body bgcolor="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">

<table class=topbox border=0 width=100%>
<tr>
<td>
<SCRIPT LANGUAGE="JavaScript">

var musiccount=1;
function playmusic(){
if ((musiccount > 10) || (musiccount < 1)){musiccount=1;}
if (musiccount==1){document.all.music.src="topbar/music/1.mp3";}
if (musiccount==2){document.all.music.src="topbar/music/2.mp3";}
if (musiccount==3){document.all.music.src="topbar/music/3.mp3";}
if (musiccount==4){document.all.music.src="topbar/music/4.mp3";}
if (musiccount==5){document.all.music.src="topbar/music/5.mp3";}
if (musiccount==6){document.all.music.src="topbar/music/6.mp3";}
if (musiccount==7){document.all.music.src="topbar/music/7.mp3";}
if (musiccount==8){document.all.music.src="topbar/music/8.mp3";}
if (musiccount==9){document.all.music.src="topbar/music/9.mp3";}
if (musiccount==10){document.all.music.src="topbar/music/10.mp3";}
}
function stopmusic(){
document.all.music.src='';
}
function forwardmusic(){
musiccount++;
if ((musiccount > 10) || (musiccount < 1)){musiccount=1;}
if (musiccount==1){document.all.music.src="topbar/music/1.mp3";}
if (musiccount==2){document.all.music.src="topbar/music/2.mp3";}
if (musiccount==3){document.all.music.src="topbar/music/3.mp3";}
if (musiccount==4){document.all.music.src="topbar/music/4.mp3";}
if (musiccount==5){document.all.music.src="topbar/music/5.mp3";}
if (musiccount==6){document.all.music.src="topbar/music/6.mp3";}
if (musiccount==7){document.all.music.src="topbar/music/7.mp3";}
if (musiccount==8){document.all.music.src="topbar/music/8.mp3";}
if (musiccount==9){document.all.music.src="topbar/music/9.mp3";}
if (musiccount==10){document.all.music.src="topbar/music/10.mp3";}
}
function rewindmusic(){
musiccount--;
if ((musiccount > 10) || (musiccount < 1)){musiccount=1;}
if (musiccount==1){document.all.music.src="topbar/music/1.mp3";}
if (musiccount==2){document.all.music.src="topbar/music/2.mp3";}
if (musiccount==3){document.all.music.src="topbar/music/3.mp3";}
if (musiccount==4){document.all.music.src="topbar/music/4.mp3";}
if (musiccount==5){document.all.music.src="topbar/music/5.mp3";}
if (musiccount==6){document.all.music.src="topbar/music/6.mp3";}
if (musiccount==7){document.all.music.src="topbar/music/7.mp3";}
if (musiccount==8){document.all.music.src="topbar/music/8.mp3";}
if (musiccount==9){document.all.music.src="topbar/music/9.mp3";}
if (musiccount==10){document.all.music.src="topbar/music/10.mp3";}
}
function music1(){
document.plbtn.src="topbar/play2.gif";}
function music2(){
document.plbtn.src="topbar/play1.gif";}
function music3(){
document.stbtn.src="topbar/stop2.gif";}
function music4(){
document.stbtn.src="topbar/stop1.gif";}
function music5(){
document.ffbtn.src="topbar/ff2.gif";}
function music6(){
document.ffbtn.src="topbar/ff1.gif";}
function music7(){
document.rrbtn.src="topbar/rr2.gif";}
function music8(){
document.rrbtn.src="topbar/rr1.gif";}
</SCRIPT>
<CENTER>
  <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="860" id="AutoNumber1">
    <tr>
      <td width="100%" align="right" valign="bottom">
      <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="100%" id="AutoNumber2">
        <tr>
          <td width="80">
          <p style="margin-top: 0; margin-bottom: 0"></td>
          <td>
      <p align="right">
      <p align="right" style="margin-top: 0; margin-bottom: 0">
      <img border="0" src="topbar/soundfx.gif" width="115" height="23"><img src="topbar/rr1.gif" BORDER="0" onClick="rewindmusic()" name="rrbtn" onMouseOver="music7()" onMouseOut="music8()" width="14" height="13"><img border="0" src="topbar/top_1.gif" width="25" height="23"><img src="topbar/play1.gif" name="plbtn" BORDER="0" onClick="playmusic()" onMouseOver="music1()" onMouseOut="music2()" width="10" height="12"><img border="0" src="topbar/top_2.gif" width="25" height="14"><img src="topbar/stop1.gif" onClick="stopmusic()" name="stbtn" BORDER="0" onMouseOver="music3()" onMouseOut="music4()" width="14" height="12"><img border="0" src="topbar/top_3.gif" width="25" height="15"><img src="topbar/ff1.gif" BORDER="0" onClick="forwardmusic()" name="ffbtn" onMouseOver="music5()" onMouseOut="music6()" width="13" height="12"><img border="0" src="topbar/top_4.gif" width="13" height="15"><bgsound src="#" id=music loop=1 autostart="true"></td>
          <td width="80">
          <p style="margin-top: 0; margin-bottom: 0"></td>
        </tr>
        <tr>
          <td width="80">&nbsp;</td>
          <td height="14" valign="top" bgcolor="#FFFFFF">
          <img border="0" src="topbar/top_left.gif" width="303" height="14"></td>
          <td width="80">&nbsp;</td>
        </tr>
      </table>
      </td>
    </tr>
    </table>
</CENTER>
</td>
</tr>
</table>
</BODY>
</HTML>
Avatar billede l34rn Nybegynder
30. januar 2009 - 10:19 #1
lukket
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester



IT-JOB