我有这段代码可以帮助我在我的页面上显示 Verite Timeline,所以:
<div id="timeline-embed"></div>
<script type="text/javascript">
var timeline_config = {
width: "100%",
height: "100%",
debug: true,
rows: 2,
source: {
"timeline":
{
"headline":"Sh*t People Say",
"type":"default",
"text":"People say stuff",
"startDate":"10/4/2011 15:02:00",
"date": [
{
"startDate":"10/4/2011 15:10:00",
"endDate":"10/4/2011 15:55:00",
"headline":"FIRST",
"text":"<p>FIRSTTEXT</p>",
"asset":
{
"caption":"yessss"
}
},
{
"startDate":"10/4/2011 17:02:00",
"endDate":"10/4/2011 18:02:00",
"headline":"SECOND",
"text":"<p>In true political fashion, his character rattles off common jargon heard from people running for office.</p>",
"asset":
{
"media":"http://youtu.be/u4XpeU9erbg",
"credit":"",
"caption":""
}
}
]
}
}
}
</script>
所以现在我想添加新元素source:
:date
{
"startDate":"CurrentDate + zajson",
"endDate":"10/4/2011 18:02:00",
"headline":"place.name",
"asset":
{
"media":"http://youtu.be/u4XpeU9erbg",
"credit":"",
"caption":""
}
}
所以场外我有一个变量:
var place.name;
var zajson;
并且当我单击时,<button>Add to timeline</button>
我想将新元素(如上所示)添加到源中:在日期中,作为新的值块...
可以这样做吗?
以及如何更新源:并在添加新数据块时再次运行它???
对不起我的英语不好