Coder Social home page Coder Social logo

smslider's Introduction

SMSlider

This is a very basic html slider that comes with a bunch of basic functionalities.

Alt Text

How to use

We must import the slider plugin

  <script src="sm_slider.js"></script>

Html structure

<div id="slider1" style="width:300px; height:480px">
   <div style="font-family: 'Inconsolata'; padding: 5px ">
     <img src="https://orig00.deviantart.net/9517/f/2017/261/9/f/fortnite___icon_by_blagoicons-dbnu8a0.png" alt="">
      <p>Fortnite is a co-op sandbox survival game developed by Epic Games and People Can Fly and published by Epic Games.</p>
   </div>
   <div>
      <img src="https://dotesports-cdn-prod-tqgiyve.stackpathdns.com/thumbor/h3VXIF_74X7PUONW1O_dhSgxIos=/900x0/filters:no_upscale()/https://dotesports-cdn-prod-tqgiyve.stackpathdns.com/article/ce1048af-f5ae-494e-9fb4-fbb8b3416fce.png" alt="">
   </div>
   <div>
      <img src="https://assets.stormshield.one/T-Icon-Weapons-SK-RPG7-L.png" alt="">
   </div>
   <div>
      <img src="https://vignette.wikia.nocookie.net/fortnite/images/2/27/Icon_Weapons_SK_Hydra_L.png/revision/latest?cb=20170806003216" alt="">
   </div>
</div>

We initialize it

    const opts = {
      container: "slider1",
      nav: true,
      autoplay: false,
      loop: true,
      dots: true
    };
    var slider1 = new SMSlider(opts);

Make sure you do import the slider plugin before starting the slider.

Options

List including all options which are optional except the container argument.

Option Description Type Default
autoplay Automtically plays the slider Boolean false
backgroundColor Sets a the background colour of each one of the slider slides. String/Number eff1f4
border Displays a border within default value between the slides. Boolean false
container Html element that we want to target as our slider container. String undefined
container Shows navigator. String undefined
currentSlide Sets the initial slide position where the portrait should be focusing. Number 0
direction Possible values 'vertical'/'horizontal'. String horizontal
dots Show dots navigation. Boolean true
navigator N/A Boolean true
slidesInView The number of slides you want to see on slider portrait. Number 1
swipeable Enables dragging events. Boolean false
thumbnails Set of thumbnails that allow us to navigate. Boolean false
transitionTime N/A Number 2
transitionFlow Possible values: 'ease', 'linear', 'ease-in', 'ease-out', 'ease-in-out' String ease

API

List of methods that the user will have access to.

displaySlide

Displays a specific slide from the slider's stack

moveSlideBackward

Moves slider to the previous slide position stack

moveSlideForward

Moves slider to the next position slide stack

stopAutoplay

Stops autoplay

playAutoplay

Plays autoplay

smslider's People

Stargazers

Ismael avatar Pedro Tall贸n avatar

Watchers

James Cloos avatar Pedro Tall贸n avatar Lorenzo Gamboa Garc铆a 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.