Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kanety/jquery-ui-durationslider


https://github.com/kanety/jquery-ui-durationslider

Last synced: 8 days ago
JSON representation

Awesome Lists containing this project

README

        

# jquery-ui-durationslider

Bind text field and jquery-ui slider for duration input.

## Dependencies

* jquery-ui

## Installation

Install from npm:

$ npm install @kanety/jquery-ui-durationslider --save

## Usage

Make a text field and `div` elements for sliders:

```html



```

Then:

```javascript
$('#text').durationslider({
h: { elem: '#hour' },
m: { elem: '#minute' }
});
```

If you want a slider for seconds:

```javascript
$('#text').durationslider({
h: { elem: '#hour' },
m: { elem: '#minute' },
s: { elem: '#second' }
});
```

Customize max value and step value:

```javascript
$('#text').durationslider({
h: { elem: '#hour', max: 48 },
m: { elem: '#minute', step: 5 }
});
```

Customize duration format:

```javascript
$('#text').durationslider({
format: 'd [DAYS] hh.mm'
});
```

* d: days
* h: hours
* m: minutes
* s: seconds
* []: raw text

Enable mousewheel support (only modern browsers):

```javascript
$('#text').durationslider({
mousewheel: true
});
```

## License

The library is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).