0.3.3 • Published 3 years ago

fro-slider v0.3.3

Weekly downloads
2
License
ISC
Repository
github
Last release
3 years ago

fro-slider

Fro-slider is fairly easy to implement into a project. it has no dependencies, redundant features and is intuitive.

Getting Started

To install the slider, you can either manually download the repository (https://github.com/froweb/fro-slider) or use npm:

$ npm install fro-slider --save

Add the css file to the section of your HTML. Then you need to apply the slider HTML code in the right place of your page. The result should look something like this:

<html>
<head>
	...
	<link rel="stylesheet" href="./fro-slider.css">
	<link rel="stylesheet" href="./default.css">
	...
</head>
<body>
  ...
  <div class="fro-slider" id="one">
    <div class="fro-slider__row">
      <img class="fro__slide" src="./images/img_1.jpg" alt="Kitty">
      <img class="fro__slide" src="./images/img_2.jpg" alt="Kitty">
      <img class="fro__slide" src="./images/img_3.jpg" alt="Kitty">
    </div>
  </div>
  ...
	<script src="./index.js"></script>
</body>
</html>

Add the lines below to your index.js file and the slider will work with default settings!

const Froslider = require('fro-slider');
...
const myFavoriteSlider = new Froslider('one');
myFavoriteSlider.play();

The default settings do not suit you? You can customize the slider like this:

const Froslider = require('fro-slider');
...
const myFavoriteSlider = new Froslider();
myFavoriteSlider.options = {
  id: 'one',
  interval: 5,
  dots: true,
  buttons: true,
  click: false,
}
myFavoriteSlider.play();

Settings

SettingDefault ValueTypeDescription
idno defaultStringID selector for the slider
interval0NumberTime (in second) to wait before changing to the next slide
dotstrueBooleanDisplay dots (markers) for easy navigation among images
buttonstrueBooleanDisplay buttons (previous / next) for easy navigation between images
clickfalseBooleanShow next image when clicking on image (does not work when showing buttons)

Demos

coming soon ...

License

ISC

0.3.3

3 years ago

0.3.2

4 years ago

0.3.0

4 years ago

0.3.1

4 years ago

0.2.2

4 years ago