You need to write your own "event painter", which has to keep track of 
which HTML element generated corresponds to which event. The standard 
event painter is here

    http://simile.mit.edu/timeline/api/scripts/painters.js

Each event has an auto-generated ID that you can use to identify 
it--search for getID in

    http://simile.mit.edu/timeline/api/scripts/sources.js

So here's what to do:
- create your own event painter class that has some method like

    openBubbleForEvent(eventID)

- in the script that creates your timeline, do a little more work when 
you call loadXML:

    tl.loadXML(
        "some-data-file.xml",
        function(xml, url) {
            eventSource.loadXML(xml, url);

            var makeEventLink = function(event) {
                var span = document.createElement("span");
                span.innerHTML = event.getText();
                span.onclick = function() {
                    var band = tl.getBand(0); // the top most band
                    band.setCenterVisibleDate(event.getStart());
                    
band.getEventPainter().openBubbleForEvent(event.getID());
                };

                // insert span somewhere in your page
            }

            var i = eventSource.getAllEventIterator();
            while (i.hasNext()) {
                var event = i.next();
                makeEventLink(event);
            }
        }
    );

- if that works for you, help us back by documenting this on our wiki :-)

Cheers,

David

Mattio Valentino wrote:
> What if I'm writing out the JavaScript dynamically, like from an ASPX
> or JSP page?  Is there anyway to indicate which bubble to display
> then?
>
> On 2/15/07, David Huynh <[EMAIL PROTECTED]> wrote:
>   
>> [EMAIL PROTECTED] wrote:
>>     
>>> Hello all,
>>> I was wondering if there was a way to open each info bubble from a link
>>> external to timeline?
>>>
>>> Say I have 10 events on timeline. Could I add 10 links at the bottom of
>>> the page to open each individual bubble?
>>>
>>> Thanks for any tips.
>>>
>>>       
>> Sorry, that's not possible. Timeline doesn't keep a mapping from each
>> event to the HTML elements generated to show that event. So there is no
>> way to know where to pop up the bubble.
>>
>> David
>>
>> _______________________________________________
>> General mailing list
>> [email protected]
>> http://simile.mit.edu/mailman/listinfo/general
>>
>>     
> _______________________________________________
> General mailing list
> [email protected]
> http://simile.mit.edu/mailman/listinfo/general
>   

_______________________________________________
General mailing list
[email protected]
http://simile.mit.edu/mailman/listinfo/general

Reply via email to