0

我在一页上有 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>
4

1 回答 1

1

好的,答案很简单......我只是给了 div 的个人名称:

例如:

<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>
于 2012-11-12T03:57:15.747 回答