>Add a scroll listener to automatically update the hidden input anytime the 
>user 
>scrolls:
>
>tl.getBand(0).addOnScrollListener(function(band) {
>    var centerDate = band.getCenterVisibleDate();
>    document.getElementById("center").value = centerDate.dateFormatAsString();
>});

*****************************************************************************
Where do I put the ScrollListener?

I have put it at the bottom of the onload function, per the following. Is this 
correct?
*****************************************************************************

function onLoad(){ var bandInfos = [ Timeline.createHotZoneBandInfo({ zones: [  
{ start: "Jan 02 1939 00:00:00 GMT-0500",    end: "Dec 31 1945 00:00:00 
GMT-0500", magnify: 39,  unit:     Timeline.DateTime.MONTH},  { start: "Jan 01 
1917 00:00:00 GMT-0500",    end: "Jan 01 1939 00:00:00 GMT-0500", magnify: 4,  
unit:     Timeline.DateTime.YEAR},  { start: "Apr 01 1945 00:00:00 GMT-0500",   
 
end: "May 01 1945 00:00:00 GMT-0500", magnify: 10,  unit:     
Timeline.DateTime.WEEK}   ], eventSource: Y95CC1A21,  date: "Jan 01 1945 
00:00:00 GMT-0500", width: "90%", layout: "original", intervalUnit: 
Timeline.DateTime.DECADE, intervalPixels: 180 }) ,  
Timeline.createHotZoneBandInfo({ zones: [  { start: "Jan 01 1930 00:00:00 
GMT-0500",    end: "Dec 29 1946 00:00:00 GMT-0500", magnify: 5,  unit:     
Timeline.DateTime.YEAR},   ], eventSource: Y95CC1A21,  date: "Jan 01 1945 
00:00:00 GMT-0500", width: "10%", layout: "overview", intervalUnit: 
Timeline.DateTime.DECADE, intervalPixels: 80 }) ]; bandInfos[1].syncWith = 0; 
bandInfos[1].highlight = true;  tl = 
Timeline.create(document.getElementById("timeline"), bandInfos); 
Timeline.loadXML("xml/NUAAW0Z81.xml", function(xml, url) { 
Y95CC1A21.loadXML(xml, url); }); }; 
tl.getBand(0).addOnScrollListener(function(band) {    var centerDate = 
band.getCenterVisibleDate();    document.getElementById("center").value = 
centerDate.dateFormatAsString();        });


 Thanks 
Jeff Roehl

-- 
You received this message because you are subscribed to the Google Groups 
"SIMILE Widgets" group.
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