The code as below:
[dynamically.php]

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
<html xmlns="http://www.w3.org/1999/xhtml";>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Timeline Dynamically</title>
<script src="http://simile.mit.edu/timeline/api/timeline-api.js"; 
type="text/javascript"></script>
</head>

<body onload="onLoad();" onresize="onResize();">
<div id="my-timeline" style="height: 150px; border: 1px solid #aaa"></div>
<script>
var tl;
function onLoad() {
  var eventSource = new Timeline.DefaultEventSource();
  var bandInfos = [
Timeline.createBandInfo({
eventSource:    eventSource,
        date:           "Jun 28 2006 00:00:00 GMT", 
width:          "70%", 
intervalUnit:   Timeline.DateTime.MONTH, 
intervalPixels: 100
}),
Timeline.createBandInfo({
eventSource:    eventSource,
        date:           "Jun 28 2006 00:00:00 GMT",
width:          "30%", 
intervalUnit:   Timeline.DateTime.YEAR, 
intervalPixels: 200
})
  ];
  bandInfos[1].syncWith = 0;
   bandInfos[1].highlight = true;
  
  tl = Timeline.create(document.getElementById("my-timeline"), bandInfos);
  tl.loadJSON("jsonized.php?"+ (new Date().getTime()), function(json, url) {
       eventSource.loadJSON(json, url);
     });
}
 var resizeTimerID = null;
function onResize() {
if (resizeTimerID == null) {
resizeTimerID = window.setTimeout(function() {
resizeTimerID = null;
tl.layout();
}, 500);
}
}
</script>


</body>
</html>

-- 
You received this message because you are subscribed to the Google Groups 
"SIMILE Widgets" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/simile-widgets/-/VgGZKN3ybqQJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/simile-widgets?hl=en.

Reply via email to