Site hosted by Angelfire.com: Build your free website today!
Midi Menu
 


TWO STEPS TO INSTALL MIDI MENU:

1. Copy the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document

**If you like the above midis, feel free to download it at my  Japanese Midi Page
 



<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->

<HEAD>

<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Nicholas Loar -->
<!-- Web Site: http://www.cass.net/~anarchy -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
songNum = new Array();
songNum[0] = "#";
songNum[1] = "http://xxx.mid";
songNum[2] = "http://xxx.mid";
songNum[3] = "http://xxx.mid";
songNum[4] = "http://xxx.mid";

var music = null;
var track = 0;
var ver = navigator.appName;
function audioCheck(plugName) {
for (var i = 0; i < navigator.plugins.length; i++) {
if (navigator.plugins[i].name.toLowerCase() == plugName.toLowerCase()) {
for (var j = 0; j < navigator.plugins[i].length; j++) {
if (navigator.plugins[i][j].enabledPlugin) {
return true;
}
}
return false;
}
}
return false;
}
function chooseSong(s) { // ie
track = s.options[s.selectedIndex].value;
if (ver == "Microsoft Internet Explorer") {
document.all.music.src = songNum[track];
} else {
songPlay('play');
}
}
function songPlay(cmd) { // netscape
if (audioCheck("LiveAudio")) {
if (cmd == 'play') {
document.musicSource.play(false, songNum[track]);
}
} else {
alert("You Do Not Have The Correct Plugin");
}
}
// End -->
</script>
</HEAD>
 


<!-- STEP TWO: Copy this code into the BODY of your HTML document -->

<BODY>

<center>
<form name=choose>
<select size=1 name=track onChange="chooseSong(this);">
<option value="0">Click For Music</option>
<option value="1">Midi 1</option>
<option value="2">Midi 2</option>
<option value="3">Midi 3</option>
<option value="4">Midi 4</option>
</select>
<input type=button onMouseDown="chooseSong(document.choose.track)" value=" Play ">
</form>

<script language="JavaScript">
<!-- Begin
var ver = navigator.appName;
if (ver == "Microsoft Internet Explorer") {
document.write('<bgsound src="#" ID=music loop=1 AUTOSTART=true>');
} else {
document.write('<embed type="audio/midi" src="aeroplane.mid" AUTOSTART=false hidden=true VOLUME="90" name="musicSource" MASTERSOUND></EMBED>');
}
// End -->
</script>
</center>


Misc Menu          Javascript Sample Menu