1.1.2 • Published 5 years ago

@hkbits/js-modal v1.1.2

Weekly downloads
-
License
ISC
Repository
-
Last release
5 years ago

js-modal

Simple Javascript function that opens links to videos or images in a modal.

Usage

Video:

import { VideoModal } from '@hkbits/js-modal';

const modal = new VideoModal(options);

<a href="video1.mp4" class="video-modal">
    Video 1
</a>

<a href="video2.mp4" class="video-modal">
    Image2
</a>

Image:

import { ImageModal } from '@hkbits/js-modal';

const modal = new ImageModal(options);

<a href="img1.png" class="image-modal">
    Image 1
</a>

<a href="img2.png" class="image-modal">
    Image2
</a>

Default options

Video:

const options = {
        showVideoCount: true,
        videoCountString: '%1 of %2',
        targetClass: 'video-modal',
        transitionTime: 200,
        autoplay: false
}

Image:

const options = {
        showImageCount: true,
        imageCountString: '%1 of %2',
        targetClass: 'image-modal',
        transitionTime: 200
}
1.1.1

5 years ago

1.1.0

5 years ago

1.1.2

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago