bigPicture.js---Lightweight and framework independent JavaScript image / video viewer.


bigPicture.js is a Lightweight (just over 4 KB minified, 2 KB gzip) and framework independent JavaScript image / video viewer.
Supports Youtube, Vimeo, and direct video links.
GitHub here
Step1:
link bigpicture.js 
<script type="text/javascript" src="BigPicture.min.js"></script>
I use bootstrap to layout the site here
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.6/css/bootstrap-grid.css"><link rel="stylesheet" type="text/css" href="main.css">
Step2:
html
1. image-container
Each picture should have two size images: the original one and thumb one.
click the thumb images to strench to big one.
When target the img, executing the bigpicture methord and replacing the src name.
js

2.local-image-container
Images pop out derive from the local original pictures with Javascript.
Setting background-image css:
css
js
When target the img named background-image, executing the bigpicture methord.
3.video-container
three types of video resources: locala,youtube and vimeo
css
js
When target the different className indexOf, executing the bigpicture methord.
The whole js file:
Build a function when click the images or videos.
js

The layout in codePen:

Popular posts from this blog

Fancyapps — easily build overlay windows with carousel

Meet Tippy.js: The Complete Tooltip Popover Plugin

Meet Mantine: A TS-Based Open-Source React Components Library