Simple Video Lightbox

Developer
Size
3,103 Kb
Views
32,384

How do I make an simple video lightbox?

A Simple method for creating a Lightbox like effect on a Vimeo Video.. What is a simple video lightbox? How do you make a simple video lightbox? This script and codes were developed by Saysora on 26 August 2022, Friday.

Simple Video Lightbox Previews

Simple Video Lightbox - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Simple Video Lightbox</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div id="wrap"> <div class="tryit"> <div class="title"> <h1>Simple Video Lightbox</h1> </div> <div class="list"> <div class="item"> <img src="http://placehold.it/800x310"> <iframe src="" width="800" height="281" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen class="hide" id="mtn"></iframe> <div class="close">X</div> </div> </div> </div>
</div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Simple Video Lightbox - Script Codes CSS Codes

* { margin: 0; padding: 0;
}
body { background: #34495e; font-family: "Helvetica";
}
#wrap { width: 960px; min-height: 400px; margin: 40px auto; background: #27ae60; border: 5px solid #27ae60; padding: 10px 0;
}
#wrap:hover { background: #ecf0f1;
}
#wrap:hover h1 { color: #27ae60;
}
.title { width: 100%; padding: 10px; margin: auto; text-align: center;
}
h1 { font-size: 2ems; color: #ecf0f1;
}
.list { padding: 10px 10px 50px;
}
.list .item { padding: 5px; width: 800px; height: 310px; margin: 0 auto; z-index: 160; background: #27ae60;
}
#wrap { -webkit-transition: all 0.2s linear; -moz-transition: all 0.2s linear; -o-transition: all 0.2s linear; transition: all 0.2s linear;
}
.thefocus { margin: auto; position: absolute; top: 30%; left: 0; bottom: 0; right: 0; width: 800px; height: 300px; z-index: 1000;
}
.blackestnight { background: rgba(0, 0, 0, 0.9); min-height: 100%; height: 100%; width: 100%; position: absolute; z-index: 40; top: 0; left: 0;
}
.close { position: absolute; bottom: 5px; right: 8px; font-size: 5ems; font-weight: bolder; display: none; color: #000; cursor: pointer;
}
.close:hover { color: #e74c3c;
}
.show { display: block;
}
.hide { display: none;
}

Simple Video Lightbox - Script Codes JS Codes

$(document).ready(function(){ $('.item').click(function(){ $(this).addClass('thefocus'); $(this).children('.close').css('display', 'block'); $('body').after('<div class="blackestnight"></div>'); $(this).children('img').hide(); $(this).children('iframe').show(); $('#mtn').attr('src','//player.vimeo.com/video/22439234'); }); $('.close').click(function(e){ $('.blackestnight').hide(); $('.item').removeClass('thefocus'); $(this).css('display', 'none'); $('.item').children('img').show(); $('.item').children('iframe').hide(); $('#mtn').attr('src', ''); e.stopPropagation(); });
});
Simple Video Lightbox - Script Codes
Simple Video Lightbox - Script Codes
Home Page Home
Developer Saysora
Username azureknight
Uploaded August 26, 2022
Rating 3.5
Size 3,103 Kb
Views 32,384
Do you need developer help for Simple Video Lightbox?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Saysora (azureknight) Script Codes
Create amazing sales emails with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!