SMVTimeLine移動端水平拖拽時間軸
來源:http://itssh.cn/post/939.html
- 實例化組件
vtimelineObj = $('#vtimeline').initSMVTimeLine({
//必須參數(shù): 數(shù)據(jù)集
data: data,
//可配置參數(shù): 一天偏移基礎(chǔ)值,[默認0.42根據(jù)天來計算,使用時根據(jù)實際情況設(shè)置,不要設(shè)置太大]
//baseValue: 0.9,
//可配置參數(shù): 時間字段,默認time
//timeField: 'time',
//可配置參數(shù): 時間展示字段,默認:timeTitle
//timeTitleField: 'timeTitle',
//可配置參數(shù): 描述字段,默認:desc
//descField: 'desc',
//可配置參數(shù): 類型字段,默認:type
//typeField: 'type',
//監(jiān)聽點擊事件
onClick: vtimelineClick
});
- 自定義監(jiān)聽事件
function vtimelineClick(data){
//
if(data){
console.log(data);
}
}
- 重新渲染時間軸
vtimelineObj.reload(data);
- 獲取時間軸數(shù)據(jù)
vtimelineObj.getData();
效果:

Paste_Image.png