0.3.9 • Published 8 years ago

tinyscroll.js v0.3.9

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

Tinyscroll.js

A tiny datetime scroller plugin for mobile device, dependencies on jquery and animate.css.

gif demo, loading . . .

demo

Usage

var ts;
if (!ts) {
    // init `ts`
    ts = new TinyScroll({
        wrapper: '#container',
        needLabel: true,
        range: ['2010/03/09 12:30:00', '2015/01/01 23:00:00'],
        time: true,
        initDate: '2011/07/20 18:30:00',
        cancelValue: '取消',
        okValue: '确定',
        okCallback: function(date) {
            alert(date);
        }
    });
} else {
    // if the `ts` is defined
    ts.showScroller();
}

Props

  • wrapper

root element to wrap datetime scroller

  • title (optional)

datetime scroller title

  • needLabel (optional)

show the section label: year, month, day, hour and minute

  • range

date range: ['2010/03/09 12:30:00', '2015/01/01 23:00:00'] or [new Date('2010/03/09 12:30:00'), new Date('2015/01/01 23:00:00')].

Attention: If the date is String, it's format must be yyyy/MM/DD hh:mm:ss.

  • time (optional)

show time scroller, default false

demo

  • initDate (optional)

initialize date: '2011/07/20 18:30:00' or new Date('2011/07/20 18:30:00').

Attention: If the date is String, it's format must be yyyy/MM/DD hh:mm:ss.

  • year (optional)

initialize stateTree.year

  • month (optional)

initialize stateTree.month

  • day (optional)

initialize stateTree.day

  • hour (optional)

initialize stateTree.hour

  • minute (optional)

initialize stateTree.minute

  • cancelValue (optional)

cancel button text

  • okValue (optional)

ok button text

  • okCallback

click ok button callback function

API

  • showScroller

when the ts is defined, should not init it again, just invoke the method to show it

Demo

  • online

http://frender.github.io/tinyscroll.js

  • local
git clone https://github.com/FrendEr/tinyscroll.js.git
cd tinyscroll.js
npm install
open index.html

Installation

npm install tinyscroll.js [--save[-dev]]
0.3.9

8 years ago

0.3.8

8 years ago

0.3.7

9 years ago

0.3.6

9 years ago

0.3.5

9 years ago

0.3.4

9 years ago

0.3.3

9 years ago

0.3.2

9 years ago

0.3.1

9 years ago

0.3.0

9 years ago

0.2.20

9 years ago

0.2.19

9 years ago

0.2.18

9 years ago

0.2.17

9 years ago

0.2.16

9 years ago

0.2.15

9 years ago

0.2.14

9 years ago

0.2.13

9 years ago

0.2.12

9 years ago

0.2.11

9 years ago

0.2.10

9 years ago

0.2.9

9 years ago

0.2.8

9 years ago

0.2.7

9 years ago

0.2.6

9 years ago

0.2.5

9 years ago

0.2.4

9 years ago

0.2.3

9 years ago

0.2.2

9 years ago

0.2.1

9 years ago

0.2.0

9 years ago

0.1.4

9 years ago

0.1.3

9 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago

0.0.7

9 years ago

0.0.6

9 years ago

0.0.5

9 years ago

0.0.4

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago