Difference between revisions of "Team:Harvard BioDesign/Notebook"
Line 5: | Line 5: | ||
<html> | <html> | ||
<head> | <head> | ||
− | <script src="http://simile.mit.edu/timeline/api/timeline-api.js" type="text/javascript"></script> | + | <script src="http://simile.mit.edu/timeline/api/timeline-api.js" type="text/javascript"></script> |
− | </head> | + | </head> |
− | <div id="my-timeline" style="height: 150px; border: 1px solid #aaa"></div> | + | <body onload="onLoad();" onresize="onResize();"> |
+ | |||
+ | <div id="my-timeline" style="height: 150px; border: 1px solid #aaa"></div> | ||
+ | |||
+ | <script> | ||
+ | var tl; | ||
+ | function onLoad() { | ||
+ | var bandInfos = [ | ||
+ | Timeline.createBandInfo({ | ||
+ | width: "70%", | ||
+ | intervalUnit: Timeline.DateTime.MONTH, | ||
+ | intervalPixels: 100 | ||
+ | }), | ||
+ | Timeline.createBandInfo({ | ||
+ | width: "30%", | ||
+ | intervalUnit: Timeline.DateTime.YEAR, | ||
+ | intervalPixels: 200 | ||
+ | }) | ||
+ | ]; | ||
+ | tl = Timeline.create(document.getElementById("my-timeline"), bandInfos); | ||
+ | } | ||
− | + | var resizeTimerID = null; | |
− | + | function onResize() { | |
− | + | if (resizeTimerID == null) { | |
− | + | resizeTimerID = window.setTimeout(function() { | |
− | + | resizeTimerID = null; | |
− | + | tl.layout(); | |
− | + | }, 500); | |
− | + | } | |
− | + | } | |
− | + | </script> | |
− | + | </body> | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | var resizeTimerID = null; | + | |
− | function onResize() { | + | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | } | + | |
− | </script> | + | |
− | + | ||
− | </body> | + | |
</html> | </html> |
Revision as of 15:54, 2 July 2015