0
我編碼的時間線通過vis.js. 而且我使用addCustomTime()附加了自定義時間項。如何防止vis.js時間線「customTime」項目移動?
我的情況是。
我想添加固定的自定義時間,但是當它拖動時它會移動。 Anbybody知道如何防止自定義項目移動?
// DOM element where the Timeline will be attached
var container = document.getElementById('visualization');
// Create a DataSet (allows two way data-binding)
var items = new vis.DataSet([
{id: 1, content: 'item 1', start: '2013-04-20'},
]);
// Configuration for the Timeline
var options = {};
// Create a Timeline
var timeline = new vis.Timeline(container, items, options);
timeline.addCustomTime('2013-04-21'); // I want this item not moving.
<link href="https://cdnjs.cloudflare.com/ajax/libs/vis/4.19.1/vis.min.css" rel="stylesheet"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vis/4.19.1/vis-timeline-graph2d.min.js"></script>
<div id="visualization"></div>