我正在尝试制作我的第一个视频背景,并找到这个管状插件。当我执行此步骤时,将代码添加到主体中似乎变得很复杂。
我添加了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/