JavaScript DHTML/Document/Sound — различия между версиями

Материал из Web эксперт
Перейти к: навигация, поиск
м (1 версия)
 
(нет различий)

Версия 09:59, 26 мая 2010

"balance" Example

    
<html>
<head>
<body>
<bgsound id="mySound" src="sound.mp3" balance="0" loop="1">
<script>
    function function1() {
        document.all.mySound.src = "sound.mp3";
        document.all.mySound.balance = -10000;
        document.all.mySound.volume = -3000; 
    } 
</script>
</head>
<body onLoad="function1();">
<input type="button" value="balance = -10000" onClick="function1();">
</body>
</html>



"loop" Example

    
<html>
<body>
<bgsound id="myBackgroundSound" src="yourmusic.wav" loop="1">
<script language="JavaScript">
    function function1() {
        document.all.myBackgroundSound.loop = 2;
    }
</script>
<input type="button" value="Set the loop value to 2" onClick="function1();">
</body>
</html>



Set Sound volume

    
<html>
<head>
<body>
<bgsound id="mySound" src="fake.mp3" balance="0" loop="1">
<script>
    function function1() {
        document.all.mySound.src = "fake.mp3";
        document.all.mySound.balance = -10000;
        document.all.mySound.volume = -3000; 
    } 
</script>
</head>
<body onLoad="function1();">
<input type="button" value="balance = -10000" onClick="function1();">
</body>
</html>