Duration Picker jQuery timeBar - Download Hozizontal Duration Picker For jQuery - timeBar.js

Download Hozizontal Duration Picker For jQuery – timeBar.js

Posted on

This time I will share jQuery Plugin and tutorial about Hozizontal Duration Picker For jQuery – timeBar.js, hope it will help you in programming stack.

Duration Picker jQuery timeBar - Download Hozizontal Duration Picker For jQuery - timeBar.js
File Size: 12.4 KB
Views Total: 3330
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

A creative jQuery duration picker plugin which makes it easy to select a time duration in seconds from a horizontal time bar with custom scales and markers.

How to use it:

1. Add the jQuery timeBar.js plugin’s files to the html page which has jQuery library loaded.

1 <link href="src/css/timebar.css" rel="stylesheet">
3         integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
4         crossorigin="anonymous">
5 </script>
6 <script src="src/js/timebar.js"></script>

2. Create a container to place the time bar.

1 <div id="timeline-demo"></div>

3. Initialize the plugin and specify an array of preset points as follows:

1 const timebar = $("#timeline-demo").timebar({
2       totalTimeInSecond: 550,
3       cuepoints: [0, 110, 220, 330, 440, 550]
4 });

4. All default options to customize the time bar.

01 const timebar = $("#timeline-demo").timebar({
02       element: null,
03       totalTimeInSecond: 0,
04       cuepoints: [],
05       width: 0,
06       globalPageX: 0,
07       selectedTime: 0,
08       multiSelect: false,
09       showCuepoints: true,
10 });

5. Callback functions that can be used to display the selected time duration.

1 const timebar = $("#timeline-demo").timebar({
2       barClicked(time) {
3         // do something
4       },
5       pointerClicked(time) {
6         // do something
7       }
8 });

6. API methods.

01 // add a new point
02 timebar.addCuepoints(time);
03  
04 // up<a href="https://www.jqueryscript.net/time-clock/">date</a>s the selected point
05 timebar.updateSelectedCuepoint(time);
06  
07 // deletes selected point
08 timebar.deleteSelectedCuepoints();
09  
10 // shows/hides points
11 timebar.showHideCuepoints();

Changelog:

2018-06-27

  • bugfixed.

This awesome jQuery plugin is developed by Pulkitchadha. For more Advanced Usages, please check the demo page or visit the official website.

source : jquery.net