0.13.22 • Published 3 years ago

jedlislider v0.13.22

Weekly downloads
1
License
MIT
Repository
github
Last release
3 years ago

jedliSlider

npm.io

DEMO page

DEMO

What is jedliSlider?

jedliSlider is interactive carousel with multiple options and modes to use on your page, created in pure (vanilla) javascript and css.

IMPORTANT: FOR NOW ONLY THE CONTINUOUS MODE IS FULLY IMPLEMENTED!

Compatibility

Slider is built on css flexbox. So will be compatible with every browser that supports flexbox.

Why jedliSlider?

Because it’s easy to use, modern and will have all options that you want. Some popular carousels still use floats and a lot of unnecessary scripts/styles. My intention was to create one slider, that will contain all things i missed in other carousels. With as low code and css as possible. So you don't need to override some default styles and download multiple libraries for specific types of carousels.

Status

IMPORTANT: FOR NOW ONLY THE CONTINUOUS MODE IS FULLY IMPLEMENTED!

React version HERE

There are currently two working modes:

  • continuous - fully implemented
  • default - check available options on DEMO page

What's new?

v. 0.13.22

  • Added resize observer to continuous mode when slidesWidth is set to "auto" so the slider will start rotate when width of slides inside change (for example image will be loaded later)

Previous update

  • Fixed bug with 'auto' width of slides in 'countinous' mode after last update

Features soon:

  • Creating dots from options
  • Creating dots with custom html
  • Custom animation of changing slides
  • Lazy load for images
  • 'Centered' mode, where some slides are bigger, smaller or highlighted by other way, with some levels of highlightness and animation between levels

How to use

Instal via npm

"npm install jedlislider"

NPM

If you work with webpack

Import slider: import jedliSlider from 'jedlislider/src-webpack/jedlislider.js'

and import styles (one of this):

  • CSS: import 'jedlislider/dist/jedlislider.bundle.css'
  • SCSS: import 'jedlislider/src-webpack/jedlislider.scss'

If you work without webpack, add this files to your wesbite by script and link tag:

  • JS: jedlislider/src/jedlislider.js

And one of this:

  • CSS: jedlislider/dist/jedlislider.bundle.css
  • SCSS: jedlislider/src/jedlislider.scss

Events

See more here

  • beforeInit
  • afterInit (it's important to declarate init events before initialization of slider)
  • beforeChange
  • afterChange
  • dragStart
  • dragEnd
  • beforeFilter
  • afterFilter

How to catch events?

  1. get your html element (for example by document.getElementById())
  2. add event listener (for example element.addEventListener('beforeChange), () => {}))
  3. ??
  4. Profit

Functions

See more here

  • prevSlide() -> Go to prev slide or slides if 'slidesToScroll is greater than 1'
  • nextSlide() -> Go to next slide or slides if 'slidesToScroll is greater than 1'
  • goToSlide(Number of slide) -> Go to specific slide
  • filter(Here category name or "all" to see all slides)

List of options

More info on DEMO page

Option:Default:Description:
modedefaultjedliSlider contain few different modes, types of carousels. Select wanted one. This option define how almost all of other options will work
slidesWidthequaldeterminate if all slides should be same size, specified by slider; or width of every slides can be different, specifed from css
visibleSlides1This option works when "slidesWidth" is set to "equal". Determinate how much slides will be visible
slidesToScroll1By how many slides should slider move, on action "nextSlide" or "prevSlide"
draggabletrueWorks only in 'default'mode, turn on/off touch/drag support
speed400Transition duration of one single change. In "continuous" mode speed is amount of ms per every single px
easinglinearDefine easing of slider move animation
overflowhiddenDefine if slider should have overflow hidden or not
pauseOnHoverfalseThis option works in "continuous" mode. Determinate if carousel should stop animation on hover, or for accessibility reasons - on focus at any element inside slider
directionleftThis option works in "continuous" mode. determinate if carousel should rotate from left to right, or right to left
preventOverScrolltrueThis option works in "default" mode. Determinate if slider should recalculate distance to animate when wanted amount of slides to scroll is greater than amount of slides. For example: (You are at 4th and 5th slide, there are 6 slides. But your slides to scroll is 2. With this option set to true instead of going 2 slides, slider will move only by 1 slide.
responsive-Set new options to work from specified breakpoint
infinitefalseThis option works in "default" mode. Set carousel to work as infinite, without end.
autoplayfalseSlider will automatically go to next/prev slide after specified time. Slider will stop change on track hover
autoplaySpeed1500Time after next/prev event will be triggered
autoplayDirectionrightDeterminate if slider after specified amount of time should go to next or prev slide
arrowsfalseDeterminate if slider should create arrows to navigate
arrowPrev / arrowNext-Allows to create arrows with custom html. Attr to handle next/prev action will be added automatically. It's necessary to set "arrows" option to true.
generateNavfalseDeterminate if slider should look for navContainer to generate nav
navContainer-Html element in which slider will look for elements with jedli-target attributes. Value of jedli-target in those elements will determinate index of slider to go To.
animationChangetransformAllows to define animation of changing slide
filterDelay0Set delay before filtering, so you could add custom animation of change or anything
0.13.22

3 years ago

0.13.21

3 years ago

0.13.20

3 years ago

0.13.19

3 years ago

0.12.19

4 years ago

0.12.18

4 years ago

0.12.17

4 years ago

0.11.16

4 years ago

0.10.16

4 years ago

0.10.15

4 years ago

0.10.14

4 years ago

0.19.14

4 years ago

0.9.13

4 years ago

0.9.12

4 years ago

0.8.11

5 years ago

0.8.10

5 years ago

0.8.9

5 years ago

0.8.8

5 years ago

0.7.8

5 years ago

0.7.7

5 years ago

0.7.6

5 years ago

0.6.6

5 years ago

0.6.5

5 years ago

0.6.4

5 years ago

0.5.4

5 years ago

0.4.4

5 years ago

0.3.4

5 years ago

0.3.3

5 years ago

0.3.2

5 years ago

0.2.2

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.0.1

5 years ago