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() {};

Readme

Keywords

none

Package Sidebar

Install

npm i csc-adv-int-basic-gallery

Weekly Downloads

1

Version

1.0.1

License

Apache-2

Unpacked Size

14.9 kB

Total Files

3

Last publish

Collaborators

  • chadhikes