JavaScript Reference/Javascript Properties/balance

Материал из Web эксперт
Версия от 08:21, 26 мая 2010; Admin (обсуждение | вклад) (1 версия)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск

"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>



"balance" is applied to

+----------------+--------------------------------------------------------------+
| Applied_To     |<bgsound>                                                     |
+----------------+--------------------------------------------------------------+



"balance" Syntax and Note

Note:
Read and write property. 
Controls the volume balance between the left and right speakers. 
Value: 
A number from
   -10000          all sound goes through the left speaker 
    to
    +10000         all sound goes through the right speaker
    
Syntax:
    
document.all.bgsoundID.balance = value