0.8.12 • Published 2 years ago

@pluginjs/swipeable v0.8.12

Weekly downloads
5
License
GPL-3.0
Repository
github
Last release
2 years ago

Swipeable

npm package

A flexible modern swipeable js plugin.

Samples

Introduction

Installation

Yarn

yarn add @pluginjs/swipeable

NPM

npm i @pluginjs/swipeable

Getting Started

CDN:

Development:

<script src="https://unpkg.com/@pluginjs/swipeable/dist/swipeable.js"></script>
<link rel="stylesheet" href="https://unpkg.com/@pluginjs/swipeable/dist/swipeable.css">

Production:

<script src="https://unpkg.com/@pluginjs/swipeable/dist/swipeable.min.js"></script>
<link rel="stylesheet" href="https://unpkg.com/@pluginjs/swipeable/dist/swipeable.min.css">

Initialize

HTML:

<div class="element"></div>

ECMAScript Module:

import Swipeable from "@pluginjs/swipeable"
import "@pluginjs/swipeable/dist/swipeable.css"

Swipeable.of(document.querySelector('.element'), options)

CommonJS:

require("@pluginjs/swipeable/dist/swipeable.css")
const Swipeable = require("@pluginjs/swipeable")

Swipeable.of(document.querySelector('.element'), options)

Browser:

<link rel="stylesheet" href="https://unpkg.com/@pluginjs/swipeable/dist/swipeable.css">
<script src="https://unpkg.com/@pluginjs/swipeable/dist/swipeable.js"></script>
<script>
  Pj.swipeable('.element', options)
</script>

API

Options

Options are called on swipeable instances through the swipeable options itself. You can also save the instances to variable for further use.

NameDescriptionDefault
"container"Container selectornull
"rebound"Support reboundfalse
"reboundPos"Set rebound position100
"offset"Set rebound offset0
"duration"Set duration400
"power"Set decay power2
"decay"Support decayfalse
"axis"Set direction, 'x' or 'y''x'

Events

Events are called on swipeable instances through the swipeable events itself. You can also save the instances to variable for further use.

NameDescription
"ready"Gets fired when plugin is ready
"enable"Gets fired when plugin is enabled
"disable"Gets fired when plugin is disabled
"destroy"Gets fired when plugin is destroy
"start"Gets fired when plugin has be start
"move"Gets fired when plugin has be move
"end"Gets fired when plugin has be end
"resize"Gets fired when plugin has be resize
"decay"Gets fired when plugin has be decay
"decayend"Gets fired when plugin has be decayend

Methods

Methods are called on swipeable instances through the swipeable method itself. You can also save the instances to variable for further use.

NameDescription
"disable"Disable plugin
"enable"Enabled plugin if plugin is disabled
"destroy"Destroy plugin

Classes

Name | Description | Default --|| "NAMESPACE" | Declare plugin namespace | pj-swipeable "VERTICAL" | Declare plugin vertical | {namespace}-vertical "CONTAINER" | Declare container node | {namespace}-container "DISABLED" | Declare plugin is disabled | {namespace}-disabled

Browser support

Tested on all major browsers.

IE / EdgeFirefoxChromeSafariOpera
IE11, Edgelast 2 versionslast 2 versionslast 2 versionslast 2 versions

License

@pluginjs/swipeable is Licensed under the GPL-v3 license.

If you want to use @pluginjs/swipeable project to develop commercial sites, themes, projects, and applications, the Commercial license is the appropriate license. With this option, your source code is kept proprietary.

For purchase an Commercial License, contact us purchase@thecreation.co.

Copyright

Copyright (C) 2022 Creation Studio Limited.

0.8.12

2 years ago

0.8.11

2 years ago

0.8.10

3 years ago

0.8.9

3 years ago

0.8.8

3 years ago

0.8.7

3 years ago

0.8.6

3 years ago

0.8.5

4 years ago

0.8.4

4 years ago

0.8.3

4 years ago

0.8.2

4 years ago

0.7.23

4 years ago

0.7.22

4 years ago

0.7.21

4 years ago

0.7.20

5 years ago

0.7.19

5 years ago

0.7.18

5 years ago

0.7.17

5 years ago

0.7.16

5 years ago

0.7.15

5 years ago

0.7.14

5 years ago

0.7.13

5 years ago

0.7.12

5 years ago

0.7.11

5 years ago

0.7.10

5 years ago

0.7.9

5 years ago

0.7.8

5 years ago

0.7.7

5 years ago

0.7.6

5 years ago

0.7.5

5 years ago

0.7.4

5 years ago

0.7.3

6 years ago

0.7.2

6 years ago

0.7.1

6 years ago

0.7.0

6 years ago

0.6.5

6 years ago

0.6.4

6 years ago

0.6.3

6 years ago

0.6.2

6 years ago

0.6.1

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago