Get started with tiny-slider CDN

MIT licensed

Tiny Slider is a lightweight and customizable library for creating responsive image carousels.

Tags:
  • vanilla javascript
  • tiny slider
  • slider

Stable version

Copied!

How to start using tiny-slider CDN


<!DOCTYPE html>
<html>
<head>
  <link rel="stylesheet" href="path/to/your/styles.css">
  <script src="https://cdn.cdnhub.io/tiny-slider/2.9.4/tiny-slider.js"></script>
  <style>
    #slider {
      width: 100%;
      height: 200px;
      border: 1px solid #ccc;
    }
    .slider__slide {
      width: 100%;
      height: 100%;
      background-size: cover;
      background-position: center;
    }
  </style>
</head>
<body>
  <div id="slider">
    <div class="slider">
      <div class="slider__container">
        <div class="slider__slide" style="background-image: url('path/to/image1.jpg')"></div>
        <div class="slider__slide" style="background-image: url('path/to/image2.jpg')"></div>
        <div class="slider__slide" style="background-image: url('path/to/image3.jpg')"></div>
      </div>
    </div>
  </div>

  <script>
    const slider = new TinySlider('#slider', {
      items: 1,
      slideBy: 1,
      autoplay: false,
      controls: false,
      loop: true,
    });
  </script>
</body>
</html>
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!

All versions