How to use the flickity.data function in flickity

To help you get started, we’ve selected a few flickity examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github benjamincharity / angular-flickity / src / flickity.service.js View on Github external
return new Promise((resolve, reject) => {
            const instance = flickity.data(element)

            if (instance) {
                // Return the instance
                return resolve(instance);
            } else {
                return reject('Instance not found for ' + element);
            }
        });
    }
github TheScienceMuseum / collectionsonline / client / lib / listeners / carousel.js View on Github external
wrapAround: thumbnails.length >= 3,
      setGallerySize: false,
      pageDots: false,
      imagesLoaded: true,
      lazyLoad: 1,
      arrowShape: {
        x0: 30,
        x1: 63.5,
        y1: 50,
        x2: 70,
        y2: 45.5,
        x3: 40
      }
    });

    var flkty = Flickity.data(carousel);
    ctx.carousel.on('select', function () {
      if (navigator.platform && /iPad|iPhone|iPod/.test(navigator.platform)) {
        document.querySelector('#openseadragon').style.width = '100%';
      }
      Array.prototype.slice.call(thumbnails).forEach((el) => {
        el.classList.remove('record-imgpanel__thumb--selected');
      });
      if (thumbnails[flkty.selectedIndex]) {
        thumbnails[flkty.selectedIndex].classList.add('record-imgpanel__thumb--selected');
        captions.forEach((el) => showHide('record-imgpanel__caption', flkty, el));
        zooms.forEach((el) => showHide('openseadragon-toolbar', flkty, el));
        rights.forEach((el) => showHide('cite__method', flkty, el));
        useImage.forEach((el) => showHide('cite__button', flkty, el));
      }
    });

flickity

Touch, responsive, flickable carousels

GPL-3.0
Latest version published 3 years ago

Package Health Score

61 / 100
Full package analysis

Popular flickity functions