loop
< html | attributes
loop
This page has been flagged with the following issues:
High-level issues:
Summary
Sets or retrieves the number of times a sound or video clip will loop when activated.
| Applies to | ? |
|---|
Examples
View live exampleThis example uses the loop property and the src property to change the number of times a background sound loops.
<SCRIPT>
function loopOnce() {
oBGSound.loop = 1;
oBGSound.src = oBGSound.src; // reload sound
}
function loopContinuously() {
oBGSound.loop = -1;
oBGSound.src = oBGSound.src; // reload sound
}
</SCRIPT>
:
<BGSOUND id="oBGSound" src="sound.wav">
<BUTTON onclick="loopOnce()">Loop Sound Once</BUTTON>
<BUTTON onclick="loopContinuously()">Loop Sound Continuously</BUTTON>
Notes
Remarks
To restart a sound or video clip after changing its loop property, set the src property or dynsrc property to itself. For example:
oBGSound.src = oBGSound.src
The following are descriptions of how the loop property works for some boundary cases. {
Syntax
Compatibility
Desktop
| Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
|---|---|---|---|---|---|
| Basic support | ? | ? | ? | ? | ? |
Mobile
| Feature | Android | BlackBerry | Chrome for mobile | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Opera Mini | Safari Mobile |
|---|---|---|---|---|---|---|---|---|
| Basic support | ? | ? | ? | ? | ? | ? | ? | ? |
See also
Related pages (MSDN)
bgSoundimginputinput type=image
This article contains content originally from external sources.
Portions of this content come from the Microsoft Developer Network: [Windows Internet Explorer API reference Article]
This tool helps to make and review comments inline.
How to Use
insert instructions, with images, here