How to use the swiper/dist/js/swiper.esm.Swiper.use function in swiper

To help you get started, we’ve selected a few swiper 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 canonical-web-and-design / snapcraft.io / static / js / public / store-categories.js View on Github external
import { Swiper, Navigation } from "swiper/dist/js/swiper.esm";
import "whatwg-fetch";
import { CATEGORY_CONFIG } from "../config/swiper.config";

Swiper.use([Navigation]);

/**
 *
 * @param {HTMLElement} holder
 * @returns {Promise}
 */
function getCategory(holder) {
  const category = holder.dataset.category;

  // Write the html and init the carousel
  const writeCategory = function(response) {
    holder.innerHTML = response;
    new Swiper(
      holder.querySelector(".swiper-container"),
      Object.assign(
        {
github ionic-team / ionic / core / src / components / slides / swiper / swiper.js View on Github external
import { Autoplay, Pagination, Scrollbar, Swiper, Zoom } from 'swiper/dist/js/swiper.esm';

Swiper.use([Pagination, Scrollbar, Autoplay, Zoom]);
export { Swiper };
github canonical-web-and-design / snapcraft.io / static / js / public / snap-details / screenshots.js View on Github external
import lightbox from "./../../publisher/market/lightbox";
import { isMobile } from "../../libs/mobile";
import { Swiper, Navigation } from "swiper/dist/js/swiper.esm";
import { SCREENSHOTS_CONFIG } from "../../config/swiper.config";
import iframeSize from "../../libs/iframeSize";

Swiper.use([Navigation]);

let screenshotsEl;

function clickCallback(event) {
  const url = event.target.dataset.original;
  const images = filterImages();

  if (url) {
    if (isMobile()) {
      window.open(url, "_blank");
      window.focus();
    } else {
      lightbox.openLightbox(url, images);
    }
  }
}