GithubHelp home page GithubHelp logo

kgruszowski / vanillaslider.js Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 0.0 42 KB

Light slider library written in VanillaJS

Home Page: https://kgruszowski.github.io/vanillaslider.js/

License: MIT License

JavaScript 46.56% CSS 19.28% HTML 34.16%
javascript slider vanilla-javascript carousel

vanillaslider.js's Introduction

vanillaslider.js

Light slider library written in plain javascript.

Demo

https://kgruszowski.github.io/vanillaslider.js/

Installation

You don't need any external libraries like jQuery, just append stylesheet and script files

<link rel="stylesheet" href="src/css/vanillaslider.css">
<script type="text/javascript" src="src/js/vanillaslider.js"></script>

HTML Structure

<div class="vanilla-slider">
    <ul class="vanilla-slider-container" data-height="300" data-width="700">
        <li><img src="img/1.png"></li>
        <li><img src="img/2.png"></li>
        <li><img src="img/3.png"></li>
        <li><img src="img/4.png"></li>
        <li><img src="img/5.png"></li>
    </ul>
</div>

Run VanillaSlider

window.onload = function () {
    var slider = document.querySelector('.vanilla-slider');
    var vanillaSlider = new VanillaSlider(slider);
    vanillaSlider.init();
};

Settings

Option Type Default Description
autoplay boolean false Enables slider autoplaying
autoplayTime int 3000 Determines time (in milliseconds) of viewing one slide
control boolean true Show/Hide control buttons
pagination boolean false Show/Hide pagination buttons

Methods

Method Arguments Description
goTo slide : int Move slider to the given slide
next Move slider to the next slide
prev Move slider to the previous slide

vanillaslider.js's People

Contributors

kgruszowski avatar czosnek7 avatar

Stargazers

Priya Dhoundiyal avatar Ivan Demidov avatar

Watchers

James Cloos avatar  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.