Tiny Content Slider with Pure JavaScript – tiny-slider

A tiny yet feature-rich content slider built using pure JavaScript and plain Html / CSS.


  • Autoplay.
  • Navigation and pagination.
  • Infinite loop like a carousel.
  • Responsive design.
  • Multiple items in one slide.
  • Custom animations.
  • Keyboard navigation.



Add the tiny-slider.css and tiny-slider.js to your webpages.

<link rel="stylesheet" href="assets/css/tiny-slider.css">
<script src="assets/js/tiny-slider.js"></script>


Add html content to the slider.

<div class="container">
  <div class="slider">
      <p>Slide 1</p>
      <p>Slide 2</p>
      <p>Slide 3</p>


Initialize the slider.

tns({container: '.container'});

You can use following options to customize the plugin.

  container: '.slider',
  mode: 'carousel', // or 'gallery'
  axis: 'horizontal', // or 'vertical'
  items: 1,
  gutter: 0,
  edgePadding: 0,
  fixedWidth: false,
  slideBy: 1,
  controls: true,
  controlsText: ['prev', 'next'],
  controlsContainer: false,
  nav: true,
  navContainer: false,
  navAsThumbnails: false,
  arrowKeys: false,
  speed: 300,
  autoplay: false,
  autoplayTimeout: 5000,
  autoplayDirection: 'forward',
  autoplayText: ['start', 'stop'],
  autoplayHoverPause: false,
  autoplayButton: false,
  autoplayButtonOutput: true,
  autoplayResetOnVisibility: true,
  loop: true,
  rewind: false,
  autoHeight: false,
  responsive: false,
  lazyload: false,
  touch: true,
  mouseDrag: false,
  swipeAngle: 15,
  nested: false,
  freezable: true,
  onInit: false

See live demo and download source code.


This awesome plugin is developed by ganlanyuan. Visit their official github repository for more information and follow for future updates.