1.1.4 • Published 3 years ago

xslider v1.1.4

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

XSlider · PRs Welcome GitHub license

XSlider is a slider library using webgl shader for transition.

  • Shader transition is easy to customize.
  • No external dependency.
  • Treat DOM structure as webgl texture.
  • It switches continuously when several slides are skipped
    slide sample
  • You can grab a slide and throw it
    drag sample

demo

Installing / Getting started

Download and install:

yarn add xslider

or

npm install xslider

Include CSS and JS files:

<!DOCTYPE html>
<html lang="en">
  <head>
    ...
    <link rel="stylesheet" href="path/to/xslider.min.css" />
  </head>
  <body>
    ...
    <script src="path/to/xslider.min.js"></script>
  </body>
</html>

Usage

A minimum sample is Here.

html

<div class="xslider">
  <div class="xslider-slide">
    <div class="xslider-page">
      <div class="xslider-layer-gl">Elements as texture</div>
      <div class="xslider-layer-ui">Elements as DOM</div>
    </div>
    <div class="xslider-page"></div>
    ...
  </div>
  <div class="xslider-pager"></div>
</div>

css

.xslider {
  width: 400px;
  height: 300px;
}

js

new XSlider('.xslider');

API

new XSlider(selector, options) or setup(selector, options)

/**
 * @constructor
 * @param {string} selector - CSS Selector
 * @param {Object} options - XSlider options. See below.
 */

new XSlider(selector, options);

options

NameTypeDefaultDescription
transitionObjectXslider.BaseTransitionTransition effect.
durationNumber1000Duration of transition between pages
initialSlideIndexNumber0Index number of initial page.
loopBooleantrueLoop page flag.
touchMoveBoolean or Object{ throwable:true }Object with touch parameters.
autoplayBoolean or ObjectfalseObject with autoplay parameters. { delay:3000 }

Browser Supports

ChromeIEEdgeFirefoxSafari
Yes--YesYes
AndroidiOS
5+8+

Licensing

MIT

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.0

3 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago

0.0.1

6 years ago