Files
timeline/README.md
yhl452493373 6ac39922ea initial commit
2021-12-16 13:25:29 +08:00

25 lines
1.6 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# timeline
jQuery简易时间轴展示刻度可选时、分
![预览图](preview.png)
用法及参数如下:
```javascript
$('.timeline').timeline({
minScale: 'minute',//最小刻度minute or hour
realtime: true,//是否实时刷新时间轴true or false。为true时若realtimeDate是当天则时间轴上的时间进度随系统时间变化而变化
limit: true,//是否限制可拖动刻度范围true or false。为true时只能在当天开始到realtimeDate范围内拖动
date: new Date(),//时间轴时间会自动取当天的0点到第二天的0作为时间轴刻度
startHour: '00',//开始小时。从第几时开始
endHour: '00',//结束小时。到第几时结束
realtimeDate: new Date(),//实时时间限制拖动范围开启后只能在当天0点到这个时间段之间拖动
loadDataDelay: 1000,//加载数据时延时。即时间轴进度改变时,延迟多久加载数据
autoPlayDuration: 100,//自动播放间隔,越小越快,最小100
animationDuration: 100,//动画时间越小越快。建议小于等于autoPlayDuration
loadData: function (time) {//时间改变后加载数据,time为时间字符串格式为yyyy-MM-dd HH:mm
},
autoPlayLoadData: function (time) {//自动播放时加载数据这里最好不要使用异步。需要自动播放的数据提前加载到页面后续新增的也是放到页面对象中扩展改数据集合。如果一定要异步需要保证其使用时间一定是小于autoPlayDuration
}
});
```