Need private packages and team management tools?Check out npm Teams »

csc-adv-int-basic-gallery

1.0.1 • Public • Published

Basic Gallery

Usage

const BasicGallery = require('csc-adv-int-basic-gallery');
 
document.addEventListener('DOMContentLoaded', () => {
  const base = document.getElementsByClassName('gallery')[0];
  const containerWidth = base.getBoundingClientRect().width;
  // 500 / 375 = containerWidth / X
  const displayHeight = Math.round((containerWidth * 375) / 500);
  base.style.height = "" + displayHeight + "px";
  const gallery = new BasicGallery(base.getElementsByClassName('full-images')[0]);
}, false);

Public Methods

/**
 * @param {!Element} container 
 * @param {{
 *     startSlide: (number|undefined),
 *     continuous: (boolean|undefined),
 *     speed: (number|undefined)
 *   }=} options
 */
constructor(container, options) { }
 
/** 
 * Advance to the next image
 */
next() { }
 
/** 
 * Advance to the previous image
 */
prev() { }
 
/**
 * A simple positive modulo using this.slides.length
 *
 * @param {number} index 
 * @return {number} 
 */
wrapIndex(index) { }
 
/**
 * @param {number} destinationIndex 
 * @param {number=} slideSpeed 
 * @param {boolean=} ignoreWrap 
 */
slide(destinationIndex, slideSpeed, ignoreWrap) {}
 
/**
 * @param {number} index 
 * @param {number} offset 
 * @param {number=} delay in milliseconds
 */
resetSlide(index, offset, delay) {}
 
/*
* Called whenever the slide index is changed. Override in derived classes
* to add specific handling.
*/
slideChanged() {};

Keywords

none

Install

npm i csc-adv-int-basic-gallery

DownloadsWeekly Downloads

0

Version

1.0.1

License

Apache-2

Unpacked Size

14.9 kB

Total Files

3

Last publish

Collaborators

  • avatar