0

我想在一个 html 页面上有两个这个画廊......但我不能只是重新复制代码。我相信我需要制作一些其他的 div id 才能正常工作……我想让一个画廊展示我的 youtube 频道,另一个画廊展示另一个 youtube 频道。

<html lang="en">
<head>
<link href="http://files.enjin.com/469593/Styles/ytv.css" type="text/css" rel="stylesheet" />
<link href="http://files.enjin.com/469593/Styles/main.css" type="text/css" rel="stylesheet" />
</head>
<body>

<div id="frame">
</div>

<!--Change user to your channel-->
<script>
window.onload = function(){
window.controller = new YTV('frame', {
user: 'midnightmafiaGUILD',
accent: 'yellow'
});

};
</script>

<div id="frame">
</div>

<!--Change user to your channel-->
<script>
window.onload = function(){
window.controller = new YTV('frame', {
user: 'other youtube channel',
accent: 'yellow'
});

};
</script>

<script type="text/javascript" src="http://files.enjin.com/469593/Styles/ytv.js"></script>
</body>
</html>
4

2 回答 2

1

尝试先加载外部脚本。

<script type="text/javascript" src="http://files.enjin.com/469593/Styles/ytv.js"></script>

<script>
window.onload = function(){
window.controller = new YTV('frame', {
user: 'midnightmafiaGUILD',
playlist: 'PLdxzlBKS1wMV2fjkYR9GA2f3t0R4CAof8',
accent: 'yellow'
});

};
</script>
于 2013-11-01T10:03:11.427 回答
0

你必须先包含youtube js然后使用它,

<script type="text/javascript" src="http://files.enjin.com/469593/Styles/ytv.js"></script>
<script>
    window.onload = function(){
        window.controller = new YTV('frame', {
            user: 'midnightmafiaGUILD',
            playlist: 'PLdxzlBKS1wMV2fjkYR9GA2f3t0R4CAof8',
            accent: 'yellow'
        });
    };
</script>
于 2013-11-01T10:03:22.163 回答