1.0.0 • Published 7 months ago
simple-image-carousel-final-yipe v1.0.0
Simple Image Carousel
A lightweight and reusable JavaScript image carousel with included CSS for transitions.
Installation
npm install simple-image-carousel
const { imageCarousel, imageCarouselCSS } = require("simple-image-carousel");
// Include the CSS (use a bundler like Webpack or manually inject it)
const style = document.createElement("style");
style.textContent = imageCarouselCSS;
document.head.appendChild(style);
// Create and use the carousel
const images = [
"./path/to/image1.png",
"./path/to/image2.png"
];
const carousel = new imageCarousel(images, 3, "unique-id");
const content = document.querySelector(".content");
carousel.slideImages(content);
1.0.0
7 months ago