웹마스터 팁

제가 개발한 랜덤으로 배경음악 지정하는 스크립트입니다.

아래의 소스를 html 문서의 head에 넣으세요.

<script>
<!--
var sound1="sound1.mid"
var sound2="sound2.mid"
var sound3="sound3.mid"
var sound4="sound4.mid"
var sound5="sound5.mid"
var x=Math.round(Math.random()*4)
if (x==0) x=sound1
else if (x==1) x=sound2
else if (x==2) x=sound3
else if (x==3) x=sound4
else x=sound5
if (navigator.appName=="Microsoft Internet Explorer")
document.write('<bgsound src='+'"'+x+'"'+' loop="infinite">')
else
document.write('<embed src='+'"'+x+'"'+'hidden="true" border="0" width="20" height="20" autostart="true" loop="true">')
//-->
</script>

\\\
*수정할 부분: sound1.mid, sound2.mid, sound3.mid, sound4.mid, sound5.mid
여기에 음악 파일의 경로를 적어 주시면 됩니다.