Code Monkey home page Code Monkey logo

mediabox's Introduction

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 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

mediabox's People

Contributors

joeldbirch avatar nickdenardis avatar pinceladasdaweb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

mediabox's Issues

Call run/render manually

Problem:

I need to manually open the popup.

Code example:

const control = document.querySelector(button);

control.addEventListener('click', (e) => {
  import('mediabox').then((mediabox) => {
    const plugin = mediabox(control);

    // Or what?
    plugin.start/render/run();
  });
})

Is it possible to do this?

Mobile close

The class need an option to close it when user clicks outside of it, or Esc is pressed.

Some feature Wanted.

It look great, i'm looking for something simple like that, what it miss is the title, may be at the left of the close button.
And i'm looking for html5 video like mp4, mpeg, ect video popup player too.
Create something like:

<video width="320" height="240" controls>
  <source src="movie.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>

Where is my copyright in css file?

Hello!

You told me added!

Where is my copyright in css file?

Please enter my copyright in css file.

Or I will make a complaint.

Good luck.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.