GithubHelp home page GithubHelp logo

fxc86 / wallopslider.js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from peduarte/wallop

0.0 1.0 0.0 1.38 MB

Simple slider with its transitions controlled via CSS

Home Page: http://pedroduarte.me/wallop-slider

License: MIT License

Shell 0.29% CSS 84.60% JavaScript 15.11%

wallopslider.js's Introduction

WallopSlider

See the website for for more detailed demos and usage.

Getting Started

Clone this repository or install with Bower.

bower install wallop-slider --save

Include the script and stylesheet on your page and initialize it.

<head>
<link rel=stylesheet href=path/to/WallopSlider.css>
</head>
<body>
<script src=path/to/WallopSlider.js></script>
<script>var slider = new WallopSlider('.wallop-slider');</script>
</body>

Options

Option Default Type
wSBtnPreviousClass 'wallop-slider__btn--previous' string
wSBtnNextClass 'wallop-slider__btn--next' string
wSItemClass 'wallop-slider__item' string
wSCurrentItemClass 'wallop-slider__item--current' string
wSShowPreviousClass 'wallop-slider__item--show-previous' string
wSShowNextClass 'wallop-slider__item--show-next' string
wSHidePreviousClass 'wallop-slider__item--hide-previous' string
wSHideNextClass 'wallop-slider__item--hide-next' string
wSCarousel false boolean

Usage:

var slider = new WallopSlider('.wallop-slider',options);

API

WallopSlider offers a basic API for you to use, so you can control it from your own buttons or gestures.

Let's say you want to go to the second slide when you click on your button.

document.querySelector('.button').addEventListener('click', function () {
  slider.goTo(2);
});

If you're using jQuery, you can do the same thing like this:

$('.button').click(function () {
  slider.goTo(2);
});

Author and license

WallopSlide has been built by Pedro Duarte.

WallopSlide is free software released under the MIT licence.

See the COPYING.MIT file or http://opensource.org/licenses/MIT for more details.

wallopslider.js's People

Contributors

eastendlab avatar sprankhub avatar gioele avatar

Watchers

oliver.feng avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.