Coder Social home page Coder Social logo

banthagroup / fslightbox Goto Github PK

View Code? Open in Web Editor NEW
328.0 6.0 29.0 75.58 MB

An easy to use vanilla JavaScript plug-in without production dependencies for displaying images, videos, or, through custom sources, anything you want in a clean overlying box.

License: MIT License

JavaScript 98.72% HTML 1.28%
gallery lightbox modal vanilla-javascript vanilla-js

fslightbox's Introduction

Vanilla JavaScript Fullscreen Lightbox Basic

Description

A vanilla JavaScript plug-in without production dependencies for displaying images, videos, or, through custom sources, anything you want in a clean overlying box. The project's website: https://fslightbox.com.

Installation

Through an archive downloaded from the website.

Just before the end of the <body> tag:

<script src="fslightbox.js"></script>

Or, through a package manager.

npm install fslightbox

And import it in your project's JavaScript file, for example through the Node.js "require" function:

require("fslightbox")

Basic usage

<a data-fslightbox="gallery" href="https://i.imgur.com/fsyrScY.jpg">
	Open the first slide (an image)
</a>
<a 
	data-fslightbox="gallery"
	href="https://www.youtube.com/watch?v=xshEZzpS4CQ"
>
	Open the second slide (a YouTube video)
</a>
<a
	data-fslightbox="gallery"
	href="https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"
>
	Open the third slide (an HTML video)
</a>
<a data-fslightbox="gallery" href="#vimeo">
	Open the fourth slide (a Vimeo video—a custom source)
</a>
<iframe
	id="vimeo"
	src="https://player.vimeo.com/video/22439234"
	width="1920px"
	height="1080px"
	frameBorder="0"
	allow="autoplay; fullscreen"
	allowFullScreen
></iframe>

Documentation

Available at: https://fslightbox.com/javascript/documentation.

Demo

Available at: https://fslightbox.com/javascript.

Browser Compatibility

Browser Works?
Chrome Yes
Firefox Yes
Opera Yes
Safari Yes
Edge Yes
IE 11 Yes

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.