All Projects → electerious → basicSlider

electerious / basicSlider

Licence: MIT License
A slider in its purest form.

Programming Languages

javascript
184084 projects - #8 most used programming language
SCSS
7915 projects

Projects that are alternatives of or similar to basicSlider

embla-carousel-wheel-gestures
wheel interactions for Embla Carousel
Stars: ✭ 30 (+11.11%)
Mutual labels:  gallery, slider
Swiper
Most modern mobile touch slider with hardware accelerated transitions
Stars: ✭ 29,519 (+109229.63%)
Mutual labels:  gallery, slider
Vue Gallery
📷 Responsive and customizable image and video gallery, carousel and lightbox, optimized for both mobile and desktop web browsers.
Stars: ✭ 405 (+1400%)
Mutual labels:  gallery, slider
React Siema
ReactSiema Demo
Stars: ✭ 90 (+233.33%)
Mutual labels:  gallery, slider
Slider
Touch swipe image slider/slideshow/gallery/carousel/banner mobile responsive bootstrap
Stars: ✭ 2,046 (+7477.78%)
Mutual labels:  gallery, slider
React Responsive Carousel
React.js Responsive Carousel (with Swipe)
Stars: ✭ 1,962 (+7166.67%)
Mutual labels:  gallery, slider
React Grid Carousel
React responsive carousel component w/ grid layout
Stars: ✭ 29 (+7.41%)
Mutual labels:  gallery, slider
MediaSliderView
Pure java based, highly customizable media slider gallery supporting both images and videos for android.
Stars: ✭ 85 (+214.81%)
Mutual labels:  gallery, slider
skeleton-carousel
Carousel component. Horizontal and vertical swipe navigation
Stars: ✭ 31 (+14.81%)
Mutual labels:  gallery, slider
vanilla-js-carousel
Tiny (1Kb gzipped) JavaScript carousel with all the features most of us will ever need.
Stars: ✭ 87 (+222.22%)
Mutual labels:  slider
horcrux
Generate you own online gallery easily. Photo is the horcrux of memory.
Stars: ✭ 34 (+25.93%)
Mutual labels:  gallery
hentai-downloader
ExHentai exhentai.org, e-hentai.org images gallery download to folder.
Stars: ✭ 37 (+37.04%)
Mutual labels:  gallery
RecyclerViewCardGallery
RecyclerView实现循环banner,替代ViewPager方案。能够快速滑动并最终定位到居中位置(相比于原库支持了循环滑动)
Stars: ✭ 610 (+2159.26%)
Mutual labels:  gallery
Generative-Art-Sketches
A Generative Art Gallery with the idea of creating a virtual Art Gallery with my creations. I have tried my hands on creating some visually appealing art using Cellular Automata, Recursive Grammar, Phyllotaxis, Sandpiles, Perlin Noise, IFS, Tiling.
Stars: ✭ 24 (-11.11%)
Mutual labels:  gallery
slider-button-card
A button card with integrated slider
Stars: ✭ 319 (+1081.48%)
Mutual labels:  slider
ios-permissions-service
An easy way to do permissions requests & handling automatically.
Stars: ✭ 25 (-7.41%)
Mutual labels:  gallery
eros-plugin-ios-TencentCaptcha
腾讯防水墙、滑动验证、类似bilibili滑动验证码
Stars: ✭ 21 (-22.22%)
Mutual labels:  slider
gallery-server
Beautiful and powerful yet simple local image viewer on your PC or mobile.
Stars: ✭ 16 (-40.74%)
Mutual labels:  gallery
hugo-travelify-theme
Port of Aigars Silkalns's Wordpress theme Travelify to Hugo. Demo -
Stars: ✭ 34 (+25.93%)
Mutual labels:  slider
react-native-big-slider
🎚️ Yet another, big one, pure JS easily customisable and hackable react-native slider component
Stars: ✭ 86 (+218.52%)
Mutual labels:  slider

basicSlider

Donate via PayPal

A slider in its purest form.

Contents

Demos

Name Description Link
Default All features with the default theme. Try it on CodePen
Responsive Responsive slider with dynamic content. Try it on CodePen
Emoji Default theme with emojis. Try it on CodePen
Touch Slider with swipe support. Try it on CodePen

Features

  • Works in all modern browsers and IE11 (with polyfills)
  • Supports any kind of content
  • No fancy shit, just a slider in its purest form
  • Zero dependencies
  • CommonJS and AMD support
  • Simple JS API

Requirements

basicSlider depends on the following browser APIs:

Some of these APIs are capable of being polyfilled in older browsers. Check the linked resources above to determine if you must polyfill to achieve your desired level of browser support.

Setup

We recommend installing basicSlider using npm or yarn.

npm install basicslider
yarn add basicslider

Include the CSS file in the head tag and the JS file at the end of your body tag…

<link rel="stylesheet" href="dist/basicSlider.min.css">
<link rel="stylesheet" href="dist/themes/default.min.css">
<script src="dist/basicSlider.min.js"></script>

…or skip the JS file and use basicSlider as a module:

const basicSlider = require('basicslider')
import * as basicSlider from 'basicslider'

API

.create(elem, slides, opts)

Creates a new basicSlider instance.

Be sure to assign your instance to a variable. Using your instance, you can…

  • …get the current slide.
  • …navigate back and forward.
  • …goto a specific slide.

Examples:

const instance = basicSlider.create(document.querySelector('#slider'), [
	'Slide 1',
	'Slide 2',
	'Slide 3'
])
const instance = basicSlider.create(document.querySelector('#slider'), [
	'<p>Slide 1 with HTML</p>',
	'<p>Slide 2 with HTML</p>',
	'<p>Slide 3 with HTML</p>'
], {
	index: 1,
	arrows: false
})

Parameters:

  • elem {Node} The DOM element/node which should contain the slider.
  • slides {Array} Array of strings. Each item represents one slide. Any kind of HTML is allowed.
  • opts {?Object} An object of options.

Returns:

  • {Object} The created instance.

Instance API

Each basicSlider instance has a handful of handy functions. Below are all of them along with a short description.

.element()

Returns the DOM element/node object associated with the instance.

Example:

const elem = instance.element()

Returns:

  • {Node} DOM element/node associated with the instance.

.length()

Returns the total number of slides.

Example:

const length = instance.length()

Returns:

  • {Number} Total number of slides.

.current()

Returns the current slide index.

Example:

const current = instance.current()

Returns:

  • {Number} Current slide index.

.goto(newIndex)

Navigates to a slide by index and executes the beforeChange and afterChange callback functions.

Example:

instance.goto(0)

Parameters:

  • newIndex {Number} Index of the slide to be displayed.

.prev()

Navigates to the previous slide and executes the beforeChange and afterChange callback functions.

Example:

instance.prev()

.next()

Navigates to the next slide and executes the beforeChange and afterChange callback functions.

Example:

instance.next()

Options

The option object can include the following properties:

{
	/*
	 * Initial slide.
	 */
	index: 0,
	/*
	 * Show or hide prev/next arrows.
	 */
	arrows: true,
	/*
	 * Show or hide dot indicators.
	 */
	dots: true,
	/*
	 * Callback functions.
	 * Returning false will stop the caller function and prevent the slider from changing.
	 */
	beforeChange: (instance, newIndex, oldIndex) => {},
	afterChange: (instance, newIndex, oldIndex) => {}
}

Themes

Layout and theme are separated CSS files. This makes it easy to style your own slider or to choose from the included themes.

Name Demo
Default theme Demo
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].