Reputation: 2860
Can someone tell me how to add new Timeline Cells for this Plugin
https://github.com/v-v-vishnevskiy/timeslider
Demo http://v-v-vishnevskiy.github.io/timeslider/demo/demo.html
JsFiddle: https://jsfiddle.net/3mn9ugc7/
//new initial
$('#slider123').TimeSlider({
init_cells: [
{'_id': 'c1', 'start': '0', 'stop': 60*5*999},
{'_id': 'c2', 'start': 60*5*1000, 'stop': 60*5*1000*2}
],
start_timestamp: 2 * 1000,
current_timestamp: (new Date()).getTime(),
//distance_between_gtitle: 100,
ruler_enable_move:1,
hours_per_ruler:1,
update_interval: 1000
});
//add new??
$('#slider123').TimeSlider({
init_cells: [
{'_id': 'c3', 'start': 60*10*1000, 'stop': 60*7*1000*2}
],
});
Upvotes: 0
Views: 49
Reputation: 88
You can add a cell by doing: $("#slider123").TimeSlider("add", cell);
But there are many actions you can do including adding, toggling, editing, removing, removing all cells and shifting the where the time slider starts.
Using "add", "toggle", "edit", "remove", "remove_all" and "new_start_timestamp" respectively. Most take a cell but remove just takes a cell id.
Upvotes: 1