0.2.6 • Published 5 years ago

sbweb-dragband v0.2.6

Weekly downloads
4
License
MIT
Repository
github
Last release
5 years ago

DragBand

UI library to create a draggable list bar

  • Native javascript
  • Responsive
  • Supports swiping

Usage

// create a dragBar with itemindex 11 selected by default
var myDragBand = dragBand.init(
    document.querySelector('#myul'), 11, {
        leftScroller : document.getElementById('left-scroll-button'),
        rightscroller : document.getElementById('right-scroll-button'),
        scrollstep : 50,
        elasticWidth : 100,
        hideScrollerMargin : 20
    });

// select no item
myDragBand.selectItem(null);

// select item with index 2
myDragBand.selectItem(2);


// create object with default options and no scrollbuttons
var simpleDragBand = dragBand.init(document.querySelector('#simple'));

Options

Configure the third parameter of init method as an object with the following properties:

PropertyTypeDescriptiondefault
leftScrollerObjectelement representing left scrollbuttonnull
rightscrollerObjectelement representing right scrollbuttonnull
scrollstepnumberpx to scroll when using wheel/scrollbutton50
elasticWidthnumberelasticity beyond left/right edges in px100
hideScrollerMarginnumberhidden buttons when with margin from edge20

Example

Check https://codepen.io/anon/pen/vzaaoL for an example.

0.2.6

5 years ago

0.2.5

6 years ago

0.2.4

6 years ago

0.2.3

6 years ago

0.2.2

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago