This time I will share jQuery Plugin and tutorial about Draggable Event Timeline Slider With jQuery – Timespace, hope it will help you in programming stack.
Timespace is a jQuery plugin for creating a dynamic, responsive, horizontal, draggable, touch-friendly timeline to display custom events in a slider manner. Click on the event slot you will sell more details about the event.
How to use it:
1. Load the latest version of jQuery (slim build) and the Timespace plugin’s JavaScript in the html page.
2 |
integrity = "sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" |
3 |
crossorigin = "anonymous" ></ script > |
4 |
< script src = "jquery.timespace.js" ></ script > |
2. Load a theme CSS of your choice in the head
section of the page.
2 |
< link href = "css/jquery.timespace.dark.css" rel = "stylesheet" > |
5 |
< link href = "css/jquery.timespace.light.css" rel = "stylesheet" > |
3. Create a container where the event timeline should appear.
1 |
< div id = "timeline" ></ div > |
4. Call the function on the container element and define your own events displayed in the timeline.
01 |
$( '#timeline' ).timespace({ |
06 |
{start: 0, end: 6, title: 'Night' }, |
07 |
{start: 6, end: 12, title: 'Morning' }, |
08 |
{start: 12, end: 18, title: 'Afternoon' }, |
09 |
{start: 18, title: 'Evening' }, |
15 |
description: 'Eat a healthy breakfast.' , |
21 |
{start: 8, end: 10, title: 'Walk' , description: 'Go for a walk.' }, |
22 |
{start: 14, title: 'Lunch' , description: 'Eat a healthy lunch.' }, |
23 |
{start: 14.75, title: 'Meeting' , description: 'Meeting with Co-workers.' }, |
5. All default options to customize the event timeline.
01 |
$( '#timeline' ).timespace({ |
24 |
shiftOnEventSelect: true , |
27 |
scrollToDisplayBox: true , |
30 |
customEventDisplay: null , |
42 |
timeSuffixFunction: s => ' ' + s[0].toUpperCase() + s[1].toUpperCase(), |
60 |
navRight: 'Move Right' , |
62 |
eventLeft: 'Previous Event' , |
63 |
eventRight: 'Next Event' , |
Change log:
v1.3.1 (2018-04-28)
- Removed background lines for better performance
v1.3.0 (2018-04-28)
- Fixed y navigation on left or right nav button click
v1.2.0 (2018-04-26)
- Removed Google font to fix getting incorrect width on text span.
- Changed navigateTime direction argument to Array [x,y] for shifting both planes.
2018-04-25
- Fixed for IE.
- Changed transparent colors to rgba
2018-04-21
- Fixed event border and wide event title clamp on nav button hold
- Fixed transition for wide event title clamp
2018-04-20
- Added controlText option and event box element getter from within callback
2018-04-19
- Fixed mousedown on titleClamp not moving time table
2018-04-17
- Added smoother time shift for end of drag.
- Added support for Touch events, and converted table to html5 for drag compatibility.
- Fixed event box overlaying other events.
2018-04-16
2018-04-15
- Changed time headings to be static within the thead
2018-04-14
- Added height constraint and Y table shifting
2018-04-13
- Added event navigation.
- Fixed display time.
2018-04-12
- Added nav button hold and other tweaks
- Fixed event overhang
- Added title for events
2018-04-11
- Added Time Heading Clamp for wide headings
- Fixed heading clamp and Added scrollToDisplayBox option
2018-04-10
This awesome jQuery plugin is developed by AdventCoding. For more Advanced Usages, please check the demo page or visit the official website.