westdc-zf1/htdocs/js/time.js

37 lines
1.1 KiB
JavaScript
Raw Normal View History

2009-03-06 03:20:46 +00:00
var tl;
function onLoad() {
var eventSource = new Timeline.DefaultEventSource();
var bandInfos = [
Timeline.createBandInfo({
width: "70%",
intervalUnit: Timeline.DateTime.MONTH,
eventSource: eventSource,
date: "Jun 28 2005 00:00:00 GMT",
intervalPixels: 100
}),
Timeline.createBandInfo({
width: "30%",
intervalUnit: Timeline.DateTime.YEAR,
eventSource: eventSource,
date: "Jun 28 2006 00:00:00 GMT",
intervalPixels: 200
})
];
bandInfos[1].syncWith = 0;
bandInfos[1].highlight = true;
tl = Timeline.create(document.getElementById("tl"), bandInfos);
tl.loadXML("/time.xml", function(xml, url) {
eventSource.loadXML(xml, url);
});
}
var resizeTimerID = null;
function onResize() {
if (resizeTimerID == null) {
resizeTimerID = window.setTimeout(function() {
resizeTimerID = null;
tl.layout();
}, 500);
}
}