A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pexea12/vue-image-lightbox below:

pexea12/vue-image-lightbox: A Vue component to display an image gallery lightbox

A simple image/video lightbox component for Vuejs NPM Package

I use CSS style from react-images

Demo!

Install the package:

npm install vue-image-lightbox vue-lazyload
yarn add vue-image-lightbox vue-lazyload

Then import it in your project At your entry point (main.js normally)

import Vue from 'vue'
import VueLazyLoad from 'vue-lazyload'
...
Vue.use(VueLazyLoad)

and use the lightbox:

import LightBox from 'vue-image-lightbox'

export default {
  components: {
    LightBox,
  },
}
<script src="path/to/vue.js"></script>
<script src="path/to/dist/vue-image-lightbox.js"></script>

You can simply view App.vue to see how to use vue-image-lightbox

Import CSS style

require('vue-image-lightbox/dist/vue-image-lightbox.min.css')
// Use only when you are using Webpack

How to use:

<light-box :media="media"></light-box>

media has the structure:

[
  { // For image
    thumb: 'http://example.com/thumb.jpg',
    src: 'http://example.com/image.jpg',
    caption: 'caption to display. receive <html> <b>tag</b>', // Optional
    srcset: '...' // Optional for displaying responsive images
  },
  { // For video
    thumb: 'https://s3-us-west-1.amazonaws.com/powr/defaults/image-slider2.jpg',
    sources: [
      {
        src: 'https://www.w3schools.com/html/mov_bbb.mp4',
        type: 'video/mp4'
      }
    ],
    type: "video",
    caption: '<h4>Monsters Inc.</h4>',
    width: 800, // required
    height: 600, // required
    autoplay: true //Optional to autoplay video when lightbox opens
  }
]
name type default description media Array required Media array to display showLightBox Boolean true Whether to show lightbox or not at the beginning startAt Number 0 Index of the image that you want to start at nThumbs Number 7 Number of thumbnail images showThumbs Boolean true Whether to show thumbnails or not autoPlay Boolean false Move to next image automatically autoPlayTime Number 3000 (ms) Time to stop at an image before move on to next image siteLoading String default image when your image is error or loading showCaption Boolean false Whether to show caption or not disableScroll Boolean true set to `true` to avoid scrolling views behind lightbox disableZoom Boolean true set to `true` to avoid zooming lightbox lengthToLoadMore Number 0 Minimum length unto end to emit load more event closable Boolean true Display the close button at the right top corner or not. ESC clicking-close will also be disabled if closable is set to false. closeText String Close (Esc) Text for the close button previousText String Previous Text for the previous image button nextText String Next Text for the next image button previousThumbText String Previous Text for the previous thumb image button nextThumbText String Next Text for the next thumb image button showFooterCount Boolean true Show footer count name arguments description nextImage () Move to next image previousImage () Move to previous image closeLightBox () Close lightbox showImage (index) Show the image at index

The content of the close button.

The content of the footer under the image.

name type description current integer Number of the current image displayed total integer Numbers of the images

The previous button on the main image.

The next button on the main image.

The previous button on the thumbs list.

The next button on the thumbs list.

The caption of the current image.

The Icon used for videos

Most of the CSS belongs to react-images


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4