Hi Larry, thanks for your feedback! The addEventCursor method is called once for each timeband to initialize the event cursor, i.e. to define the initial current event (by default this is the most current event). Furthermore addEventCursor adds a select listener for every event.
The event listener is needed so that the user can define a new current event by clicking on in the timeline. If I avoided this, things would get confusing (the user activates an event in the timeline, but the current event doesn't change). I haven't yet tested the Event Cursor for huge timelines. And i need to make it work with multiple timebands (the user activates a timeband by clicking on it --> navigation controls figure out which band was meant). But also a "combined" mode could be interesting: jump to the closest event on any timeband. About the "active timeband": i think an event listener to retrieve the active timeband (the one the user last clicked on) would be a useful core feature. Greetings, Franz On 26 Jan., 22:08, Larry Kluger <[email protected]> wrote: > Hi Franz, > > Looks good to me for Timelines that want to have a "current event" model as > part of their User Interface. > > Only quick comment is on the addEventCursor method. Is that method called for > every event? Or just some of them? In either case, the issue to watch out for > is creating additional listeners for the events. For larger Timelines, an > event listener per event can really slow things down. > > In my project, instead of adding a per-Event listener, I added one listener > per band, and then used the YUI library YAHOO.util.Event method getTarget to > resolve the mouse click event to the specific Timeline event being clicked. > > Once you've finalized your software, let us know and I'll create a wiki page > that describes it. > If you'd also like to provide an example file that demonstrates the > functionality, that'd be great and I'd be happy to add it to the Timeline > tree. > > Regards, > > Larry > > ________________________________ > From: jqueryui-vienna <[email protected]> > To: SIMILE Widgets <[email protected]> > Sent: Monday, January 26, 2009 9:33:47 AM > Subject: Previous/Next Navigation for Timeline > > Hi, > > I tried to implement sortof "Previous/Next Event" Navigation > functionality by enhancing Timeband and EventSource classes. Here is > my code: > > http://pastebin.ca/1318568 > > Simplest Usage: > Javascript: > //save the javascript from the link above to a js file and embed it > via <script>-tag > //after this line: > mytimeline = Timeline.create(document.getElementById("my-timeline"), > bandInfos); > //you have to add this line to enable navigation for the first > timeband > mytimeline.getBand(0).addEventCursor({show_bubble: true}); > > HTML: > <!-- add these lines after the timeline div in the html body--> > <button title="show first event" onclick="mytimeline.getBand > (0).moveToFirstEvent(true);"><<</button> > <button title="show previous event" onclick="mytimeline.getBand > (0).moveToPreviousEvent(true);"><</button> > <button title="show next event" onclick="mytimeline.getBand > (0).moveToNextEvent(true);">></button> > <button title="show latest event" onclick="mytimeline.getBand > (0).moveToLatestEvent(true);">>></button> > > Your Feedback is highly appreciated! > I will put a more advanced example online once I can spare some > minutes. > > Greetings, > > Franz --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
