Bootstrap Like Carousel In Vanilla JavaScrtipt – SliderJS

Category: Javascript , Slider | April 23, 2020
Author:vikas-kukreti
Views Total:1,144 views
Official Page:Go to website
Last Update:April 23, 2020
License:MIT

Preview:

Bootstrap Like Carousel In Vanilla JavaScrtipt – SliderJS

Description:

The SliderJS JavaScript library helps you generate a responsive, full-width slider/carousel inspired by the Bootstrap 4 carousel component.

How to use it:

1. Load the SliderJS’ files in the HTML page.

<link rel="stylesheet" href="res/style.main.css" />
<script src="res/script.main.js"></script>

2. You can embed whatever you want insider the slider.

<div class="slider" id="slider">

  <!-- You can embed whatever you want insider this and provide custom styling -->
  <div class="slider-item">
    <img src="1.jpg">
  </div>

  <div class="slider-item">
    <img src="2.jpg">
  </div>

  <div class="slider-item">
    <img src="3.jpg">
  </div>

  <!-- Next/Prev Navigation -->
  <button class="prev">
    <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M5 3l3.057-3 11.943 12-11.943 12-3.057-3 9-9z"/></svg>
  </button>
  <button class="next">
    <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M5 3l3.057-3 11.943 12-11.943 12-3.057-3 9-9z"/></svg>
  </button>

  <!-- Slider Background to provide initial height of cool background -->
  <img class="background" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPAAAABfCAYAAADWH0qpAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAABBdEVYdERlc2NyaXB0aW9uADRrIHdhbGxwYXBlciBMb3ZlbHkgNGsgbWluaW1hbGlzdCB3YWxscGFwZXIgNjcgaW1hZ2VznMvVCQAAABl0RVh0Q29weXJpZ2h0ADRyZWNlbnRjYXJzLmNvbdzHkxgAAABBdEVYdENvbW1lbnQAQ1JFQVRPUjogZ2QtanBlZyB2MS4wICh1c2luZyBJSkcgSlBFRyB2ODApLCBxdWFsaXR5ID0gOTAKfVTa3QAAATFJREFUeF7t08EJwDAAAzGn++/c5tElDiQwnuDOtvcOCHr+B4IEDGEChjABQ5iAIUzAECZgCBMwhAkYwgQMYQKGMAFDmIAhTMAQJmAIEzCECRjCBAxhAoYwAUOYgCFMwBAmYAgTMIQJGMIEDGEChjABQ5iAIUzAECZgCBMwhAkYwgQMYQKGMAFDmIAhTMAQJmAIEzCECRjCBAxhAoYwAUOYgCFMwBAmYAgTMIQJGMIEDGEChjABQ5iAIUzAECZgCBMwhAkYwgQMYQKGMAFDmIAhTMAQJmAIEzCECRjCBAxhAoYwAUOYgCFMwBAmYAgTMIQJGMIEDGEChjABQ5iAIUzAECZgCBMwhAkYwgQMYQKGMAFDmIAhTMAQJmAIEzCECRjCBAxhAoYwAUOYgCFMwJC1fQ6sAb3QNcqwAAAAAElFTkSuQmCC">

  <!-- Pagination Lines -->
  <span class="switch">
  </span>
  
</div>

You Might Be Interested In:


Leave a Reply