html - jQuery-管状插件问题

标签 html video background youtube tubular

我正在尝试制作我的第一个视频背景,并找到这个管状插件。当我执行此步骤时,将代码添加到主体中似乎变得很复杂。
我添加了jquery链接,由于某种原因,我添加的代码无效。
谁能帮我如何使此插件正常工作?

这是我要遵循的指令:
https://code.google.com/p/jquery-tubular/

先感谢您!

这是我的代码:

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Using Tubular Plugin</title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"         type="text/javascript"></script>
<script type="text/javascript" charset="utf-8" src="js/jquery.tubular.1.0.js"></script>
<style type="text/css">
body,html { margin:0; padding::0; height:100%; width:100%;}
#topSection {
background-color: #D8D8D8;
height:100%;
min-height:100%;
width:100&;
position:relative;

}
</style>
</head>
<body>
 $().ready(function() {
            $('#wrapper').tubular({videoId: 'idOfYourVideo'}); // where idOfYourVideo is the YouTube ID.
    });
<section id="topSection">Top section- I need a youtube video background     here</section>
</body>
</html>

最佳答案

嗨,您是否尝试过从头调用jQuery。您应该添加一段代码,例如:

<script>
$("document").ready(function() {
  var options = {  videoId: "xp-8HysWkxw", // where idOfYourVideo is the YouTube ID.
                   start: 0, 
                   repeat: true
                };    
$("#page").tubular(options); // Here is the jQuery call
});
</script>

关于html - jQuery-管状插件问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28200390/

相关文章:

javascript - 拉伸(stretch) Swiffy SVG

html - 多彩多姿的占位符文本

javascript - 加载资源失败:net::ERR_EMPTY_RESPONSE http://test.com

video - 如何在 Visual Basic 6 中播放流中的视频

Java Swing 淡出背景

IOS 7 按钮背景不起作用

validation - CSS3 背景渐变不验证,谁能告诉我为什么?里面的代码示例

javascript - 为什么我的 javascript 函数没有在我的 div 中被调用?

javascript - 使用 JS 在 Firefox 中禁用 HTML5 视频的键盘事件

android - ffmpeg根据传感器数据旋转视频