我在一个页面上有3个视频,但只有第一个加载。
我知道我必须为每个循环创建一个,但我不确定如何去做。谁能指出我正确的方向?感谢
我的页面如下:
<script type="text/javascript" src="jwplayer.js"></script>
<div class="container">Loading the player ...</div>
<script type="text/javascript">
jwplayer("container").setup({
flashplayer: "/jwplayer/player.swf",
file: "vid1.flv",
height: 270,
width: 480
});
</script>
<div class="container">Loading the player ...</div>
<script type="text/javascript">
jwplayer("container").setup({
flashplayer: "/jwplayer/player.swf",
file: "vid2.flv",
height: 270,
width: 480
});
</script>
<div class="container">Loading the player ...</div>
<script type="text/javascript">
jwplayer("container").setup({
flashplayer: "/jwplayer/player.swf",
file: "vid3.flv",
height: 270,
width: 480
});
</script>
答案 0 :(得分:0)
好的答案很简单......我只给了div个人名字:
EG:
<div id="container1">Loading the player ...</div>
<script type="text/javascript">
jwplayer("container1").setup({
flashplayer: "/jwplayer/player.swf",
file: "vid1.flv",
height: 270,
width: 480
});
</script>
<div id="container2">Loading the player ...</div>
<script type="text/javascript">
jwplayer("container2").setup({
flashplayer: "/jwplayer/player.swf",
file: "vid2.flv",
height: 270,
width: 480
});
</script>