/mediabox

Responsive Lightbox Plugin for Youtube and Vimeo with Vanilla JS

Primary LanguageJavaScriptMIT LicenseMIT

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');
</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 Chrome Firefox Opera Safari
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.

License

MIT