Lets say I have two timelines on the screen, TEOI81A2X and ECZQB1A2X.

And I want to add a third timeline MFBN61A2X.

I wold insert a new div named DIVMFBN61A2X into the DOM, like this:


<div id="DIVMFBN61A2X" class="timeline-default" style="height: 300px; 
border-width: 2px; border-style: solid; border-color: black;"></div>

And then run the following script:


/**/
var MFBN61A2X;
jQuery(document).ready(function () {
    var eventSourceMFBN61A2X = new Timeline.DefaultEventSource(0);
    var themeMFBN61A2X = Timeline.ClassicTheme.create();
    themeMFBN61A2X.event.bubble.width = 350;
    themeMFBN61A2X.event.bubble.height = 300;
    var dMFBN61A2X = "Fri Oct 18 1765";
    var bandInfosMFBN61A2X = [
    Timeline.createHotZoneBandInfo({
        width: "80%",
        intervalUnit: Timeline.DateTime.DECADE,
        intervalPixels: 50,
        date: dMFBN61A2X,
        theme: themeMFBN61A2X,
        layout: 'original',
        zones: [{
            start: "Jan 01 1800 00:00:00 GMT-0500",
            end: "Mar 04 1820 00:00:00 GMT-0500",
            magnify: 2,
            unit: Timeline.DateTime.YEAR
        }],
        eventSource: eventSourceMFBN61A2X,
        theme: themeMFBN61A2X
    }), Timeline.createBandInfo({
        width: "20%",
        intervalUnit: Timeline.DateTime.CENTURY,
        intervalPixels: 200,
        date: dMFBN61A2X,
        theme: themeMFBN61A2X,
        layout: 'overview',
        eventSource: eventSourceMFBN61A2X,
        theme: themeMFBN61A2X
    })];

    bandInfosMFBN61A2X[1].syncWith = 0;
    bandInfosMFBN61A2X[1].highlight = true;
    MFBN61A2X = Timeline.create(document.getElementById("DIVMFBN61A2X"), 
bandInfosMFBN61A2X, Timeline.HORIZONTAL);
    MFBN61A2X.hideLoadingMessage();
    MFBN61A2X.loadXML("xml/PIAVD14G1.xml", function (xml, url) {
        eventSourceMFBN61A2X.loadXML(xml, url);
    });
});

TEOI81A2X.getBand(0).removeOnScrollListener();

TEOI81A2X.getBand(0).addOnScrollListener(function (band) {
    var centerDateVOY3K0LEW = band.getCenterVisibleDate();
    VOY3K0LEW.getBand(0).setCenterVisibleDate(centerDateVOY3K0LEW);
});

VOY3K0LEW.getBand(0).removeOnScrollListener();

VOY3K0LEW.getBand(0).addOnScrollListener(function (band) {
    var centerDateECZQB1A2X = band.getCenterVisibleDate();
    ECZQB1A2X.getBand(0).setCenterVisibleDate(centerDateECZQB1A2X);
});

ECZQB1A2X.getBand(0).removeOnScrollListener();

ECZQB1A2X.getBand(0).addOnScrollListener(function (band) {
    var centerDateMFBN61A2X = band.getCenterVisibleDate();
    MFBN61A2X.getBand(0).setCenterVisibleDate(centerDateMFBN61A2X);
});

MFBN61A2X.getBand(0).removeOnScrollListener();

MFBN61A2X.getBand(0).addOnScrollListener(function (band) {
    var centerDateTEOI81A2X = band.getCenterVisibleDate();
    TEOI81A2X.getBand(0).setCenterVisibleDate(centerDateTEOI81A2X);
});

 
Thanks 
Jeff Roehl
[email protected]
(818) 912-7530


>________________________________
> From: kasaba <[email protected]>
>To: SIMILE Widgets <[email protected]> 
>Sent: Monday, March 5, 2012 11:17 AM
>Subject: [Simile-Widgets] Re: How to set new timeline center date, when 
>filtering is done?
> 
>Thanks a lot,
>
>but how to get timeline TEOI81A2X from javascript, and where (what
>function) I have to put that logic
>
>TEOI81A2X.getBand(0).removeOnScrollListener();
>
>TEOI81A2X.getBand(0).addOnScrollListener(function(band) {
>var centerDateVOY3K0LEW = band.getCenterVisibleDate();
>VOY3K0LEW.getBand(0).setCenterVisibleDate(centerDateVOY3K0LEW);
>
>});
>
>-- 
>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.
>
>
>
>

-- 
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