/    Sign up×
Community /Pin to ProfileBookmark

this may be an idiotic question but is there a way to have th bg music to a page play once and then switch song??

to post a comment
HTML

3 Comments(s)

Copy linkTweet thisAlerts:
@JonaMay 23.2003 — [b][font=arial][color=maroon]Yes, it's possible but not with HTML exclusively. This will take some Javascript programming. That is, to my knowledge there is no built-in HTML that will do this.[/color][/font][/b]
Copy linkTweet thisAlerts:
@richardiler172authorMay 23.2003 — anyone know how it's done exactly?
Copy linkTweet thisAlerts:
@JonaMay 23.2003 — [font=courier new]

<script type="text/javascript">

<!--

var change;

var f2 = "file2.mid"; //change to the name of your second file

function playSong(){

document.getElementByTagName("BGSOUND")[0].src=f2;

}

function start(){

var time = 60; //amount in seconds

time *= 100;

change = setTimeout("playSong();", time);

}

//-->

</script></head><body onload="start();">

<bgsound src="file1.mid">

</body></html>

[/font]
×

Success!

Help @richardiler172 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...