SMVTimeLine移动端水平拖拽时间轴

作者: 圆梦人生 | 来源:发表于2017-05-18 11:38 被阅读76次

SMVTimeLine移动端水平拖拽时间轴

来源:http://itssh.cn/post/939.html

  • 实例化组件
vtimelineObj = $('#vtimeline').initSMVTimeLine({
    //必须参数: 数据集
    data: data,
    //可配置参数: 一天偏移基础值,[默认0.42根据天来计算,使用时根据实际情况设置,不要设置太大]
    //baseValue: 0.9,
    //可配置参数: 时间字段,默认time
    //timeField: 'time',
    //可配置参数: 时间展示字段,默认:timeTitle
    //timeTitleField: 'timeTitle',
    //可配置参数: 描述字段,默认:desc
    //descField: 'desc',
    //可配置参数: 类型字段,默认:type
    //typeField: 'type',
    //监听点击事件
    onClick: vtimelineClick
});

  • 自定义监听事件
function vtimelineClick(data){
   //
   if(data){
    console.log(data);  
   }
}
  • 重新渲染时间轴
vtimelineObj.reload(data);
  • 获取时间轴数据
vtimelineObj.getData();

效果:

Paste_Image.png

来源:http://itssh.cn/post/939.html

相关文章

网友评论

    本文标题:SMVTimeLine移动端水平拖拽时间轴

    本文链接:https://www.haomeiwen.com/subject/cgksxxtx.html