-1
我試圖讓視頻填充整個可視屏幕。我希望能夠看到我的網站何時加載視頻和位於視頻底部的h1標籤 - (歡迎訪問網站)。強制視頻以填充整個可視屏幕
我有以下的HTML文檔的結構:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'></script>
</head>
<body>
<div id="logo"><img src="bdlogo.png" width="100%" height="100%" alt="Home"></a></div>
<div id="nav"></div>
<div id="videoclip">
<video autoplay loop>
<source src="walking.mp4" type="video/mp4">
<source src="walking.ogg" type="video/ogg">
<source src="walking.mov" type="video/mov">
<img src="frame1.png"/>
Your browser does not support the video tag.
</video>
</div>
<div id="opacity">
<div id="space"></div>
<h1 class="low">welcome to website</h1>
</div>
<div id="content"><h1 class="low">content <span class="red">here<span></h1></div>
</body>
</html>
在本文檔的<head>
節我註冊以下CSS樣式:
#logo
{
position: fixed;
top: 10px;
left:50px;
width:140px;
height:50px;
background-image: url("paper.gif");
z-index:3;
}
#opacity
{
width: 100%;
height:460px;
color: #fff;
opacity: 1.0;
filter: alpha(opacity=100); /* For IE8 and earlier */
position: absolute:
top:225px;
}
#content
{
width: 100%;
height:800px;
background-color:white;
color: #black important!;
}
.low
{
border: 0 none;
display: inline-block;
font-size: 80px;
padding: 0 20px;
line-height: 100px;
margin-bottom: 0;
margin-top: 15px;
text-transform: uppercase;
}
h1{font-family: Arial, Helvetica, sans-serif;}
#space
{
width:100%;
height:355px;
}
.red {color:red;}
html, body
{
margin:0;
padding:0;
}
#nav
{
height:70px;
width:100%;
display: none;
position: fixed;
background-color:#fff;
z-index: 2;
}
video
{
width: 100% !important;
height: auto !important;
visibility:hidden;
}
#videoclip
{
position: fixed;
z-index: -1;
}
而這一塊的Javascript代碼:
$(window).load(function(){
$(window).bind("scroll", function() {
if ($(this).scrollTop() > 50) {
$("#nav").fadeIn();
} else {
$("#nav").stop().fadeOut();
}
});
});//]]>
jQuery(document).ready(function(){
/* stop the black video loading box */
delayShow();
});
function delayShow() {
var secs = 400;
setTimeout('jQuery("video").css("visibility","visible");', secs);
}
我該如何做到這一點?