mediabox
v1.1.3
Published
Responsive Lightbox Plugin for Youtube and Vimeo with Vanilla JS
Downloads
834
Readme
MediaBox
Responsive Lightbox Plugin for Youtube and Vimeo with Vanilla JS
Demo
View demo here
Install
With npm
npm install mediabox --save
Download
You can download the latest version or checkout all the releases here.
How to use?
Require the package or use the global mediabox
namespace and include style:
commonJS
var mediabox = require('mediabox');
ES6
import mediabox from 'mediabox';
Browser
<link rel="stylesheet" type="text/css" href="path/to/mediabox.css">
<script src="path/to/mediabox.js"></script>
<script>
MediaBox('.mediabox');
MediaBox('.mediabox', { rel: '0' }); // Additional options
</script>
Now add class to links, for example:
<a href="https://www.youtube.com/watch?v=3qyhgV0Zew0" class="mediabox">Youtube</a>
<a href="https://vimeo.com/71495477" class="mediabox">Vimeo</a>
Browser Support
| | | | --- | --- | --- | --- | --- | IE 10+ ✔ | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ |
Thanks
Many thanks to Qassim Alobaidi, who originally created the plugin for jQuery.
Contributing
Check CONTRIBUTING.md for more information.
History
Check Releases for detailed changelog.