HTML CSS Reference/HTML Tag Reference/bgsound
Содержание
"bgsound" CSS Attributes and JavaScript Style Properties
+----------------+--------------------------------------------------------------+
| CSS |behavior text-autospace |
| Attributes |text-underline-position |
+----------------+--------------------------------------------------------------+
"bgsound" Event Handlers
+----------------+--------------------------------------------------------------+
| Event |onLayoutComplete onMouseEnter |
| Handlers |onMouseLeave onReadyStateChange |
+----------------+--------------------------------------------------------------+
"bgsound" Example
<html>
<head>
<title>bgsound element example</title>
<bgsound src="yoursoundfile.wav" loop="3">
<script language="javascript">
function stopSound() {
document.all.tags("bgsound")[0].volume = -10000;
}
function restartStop() {
document.all.tags("bgsound")[0].volume = 0;
}
</script>
</head>
<body>
<button type="button" onClick="stopSound()">Stop the music</button>
<br>
<button type="button" onClick="restartStop()">Restart the music</button>
</body>
</html>
"bgsound" HTML Attributes
+----------------+--------------------------------------------------------------+
| HTML |balance id |
| Attributes |loop src |
| |volume |
+----------------+--------------------------------------------------------------+
"bgsound" JavaScript Collections
+----------------+--------------------------------------------------------------+
| JavaScript |all attributes |
| Collections |behaviorUrns |
+----------------+--------------------------------------------------------------+
"bgsound" JavaScript Methods
+----------------+--------------------------------------------------------------+
| JavaScript |addBehavior applyElement |
| Methods |attachEvent clearAttributes |
| |cloneNode componentFromPoint |
| |detachEvent dragDrop |
| |fireEvent getAttribute |
| |getAttributeNode getElementsByTagName |
| |insertAdjacentElement mergeAttributes |
| |normalize removeAttribute |
| |removeAttributeNode removeBehavior |
| |setAttribute setAttributeNode |
| |swapNode |
+----------------+--------------------------------------------------------------+
"bgsound" JavaScript Properties
+----------------+--------------------------------------------------------------+
| JavaScript |balance canHaveHTML |
| Properties |disabled id |
| |isContentEditable isDisabled |
| |isMultiLine loop |
| |nextSibling nodeName |
| |nodeType nodeValue |
| |outerHTML outerText |
| |parentElement parentNode |
| |parentTextEdit previousSibling |
| |readyState scopeName |
| |sourceIndex src |
| |tagName tagUrn |
| |uniqueID volume |
+----------------+--------------------------------------------------------------+
"bgsound" Microsoft Behaviors
+----------------+--------------------------------------------------------------+
| Microsoft |clientCaps download |
| Behaviors |homePage |
+----------------+--------------------------------------------------------------+
"bgsound" Syntax and Note
Note:
Play a sound while the user visits the page.
<bgsound> is only allowed inside the <head> element.
The sound file specified in its src attribute.
The file format can be in the .wav, .au, or .mid formats.
Syntax:
<bgsound attributes events>