am used the below code, but is iNeed help to insert a video inside the lightbox div
I am developing a website in that i want to Play some videos on the div lightbox (while clicking the link), Please let me know what is the wrong inthe below code.
<html>
<head>
<title>Light Box Video EXAMPLE</title>
<style>
.black_overlay{
display: none;
position: absolute;
top: 0%;
left: 0%;
width: 100%;
Height: 100%;
background-color: black;
z-index:1001;
-moz-opac开发者_StackOverflow中文版ity: 0.5;
opacity:.80;
filter: alpha(opacity=63);
}
.white_content {
display: none;
position: absolute;
top: 25%;
left: 25%;
width: 600px;
height: 290px;
padding: 1px;
border: 16px solid orange;
background-color: white;
z-index:1002;
overflow: auto;
}
</style>
</head>
<body>
Clic here to open the light box.
<a href = "#" onclick ="fShowDiv()">here</a>
<div id="light" class='white_content'>Here i need the Video so that when the user click the Link it will open the lightdiv and play the vedio
Your a has an onclick attribute 'fShowDiv()', which means that when the a is clicked the function fShowDiv should be executed. This function is missing from your code. The following works for me:
<html>
<head>
<title>Light Box Video EXAMPLE</title>
<style>
.black_overlay {
display: none;
position: absolute;
top: 0%;
left: 0%;
width: 100%;
height: 100%;
background-color: black;
z-index:1001;
-moz-opacity: 0.5;
opacity:.80;
filter: alpha(opacity=63);
}
.white_content {
display: none;
position: absolute;
top: 25%;
left: 25%;
width: 600px;
height: 290px;
padding: 1px;
border: 16px solid orange;
background-color: white;
z-index:1002;
overflow: auto;
}
</style>
<script type="text/javascript">
function fShowDiv()
{
document.getElementById('light').style.display = 'block'
document.getElementById('fade').style.display = 'block'
}
</script>
</head>
<body>
Clic here to open the light box.
<a href = "#" onclick ="fShowDiv()">here</a>
<div id="light" class='white_content'>
Here i need the Video so that when the user click the Link it will open the lightdiv and play the vedio
</div>
<div id="fade" class="black_overlay"></div>
</body>
</html>
精彩评论