simple link to target a date on Timeline?

View: New views
5 Messages — Rating Filter:   Alert me  

simple link to target a date on Timeline?

by rlaird :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I've got my timeline up and running on a web page, but would like to put HTML links below it (not part of the js script) that a user can click on and it will move the timeline and zero in on the item they clicked on.  What's the simplest way to do that?

  -- Robert



--
Why did the chicken cross the Mobius strip? To get to the other, er, um....

_______________________________________________
General mailing list
General@...
http://simile.mit.edu/mailman/listinfo/general

Re: simple link to target a date on Timeline?

by Josh Aresty :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hey Robert,

If this is just timeline (e.g. not using Exhibit) then I think what you need is to call timeline.showBubbleForEvent(
"eventID") to scroll directly to and show a bubble for an event. 

If you don't want to show the bubble, then you can write a function that does this:

var evt = timeline.getEventSource().getEvent(eventID);
if (evt) {
 timeline.scrollToCenter(evt.getStart());
}

Josh


2008/6/19 Robert Laird <rlaird@...>:
I've got my timeline up and running on a web page, but would like to put HTML links below it (not part of the js script) that a user can click on and it will move the timeline and zero in on the item they clicked on.  What's the simplest way to do that?

  -- Robert



--
Why did the chicken cross the Mobius strip? To get to the other, er, um....

_______________________________________________
General mailing list
General@...
http://simile.mit.edu/mailman/listinfo/general




--
Best,
Josh Aresty
Systems Administrator/Programmer
MIT LLARC
_______________________________________________
General mailing list
General@...
http://simile.mit.edu/mailman/listinfo/general

Re: simple link to target a date on Timeline?

by rlaird :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Josh --

Thanks for the info...  I'm an old hand at HTML, but not as confident around javascript.  If this is a discrete function that I'm calling, don't I have to reference the timeline instance?

Also, none of my XML has an eventID... I have the start, end, title, etc., but no eventID... what is it?

  -- Robert


2008/6/19 Josh Aresty <jaresty@...>:
Hey Robert,

If this is just timeline (e.g. not using Exhibit) then I think what you need is to call timeline.showBubbleForEvent(
"eventID") to scroll directly to and show a bubble for an event. 

If you don't want to show the bubble, then you can write a function that does this:

var evt = timeline.getEventSource().getEvent(eventID);
if (evt) {
 timeline.scrollToCenter(evt.getStart());
}

Josh


2008/6/19 Robert Laird <rlaird@...>:
I've got my timeline up and running on a web page, but would like to put HTML links below it (not part of the js script) that a user can click on and it will move the timeline and zero in on the item they clicked on.  What's the simplest way to do that?

  -- Robert



--
Why did the chicken cross the Mobius strip? To get to the other, er, um....

_______________________________________________
General mailing list
General@...
http://simile.mit.edu/mailman/listinfo/general




--
Best,
Josh Aresty
Systems Administrator/Programmer
MIT LLARC

_______________________________________________
General mailing list
General@...
http://simile.mit.edu/mailman/listinfo/general




--
Why did the chicken cross the Mobius strip? To get to the other, er, um....

_______________________________________________
General mailing list
General@...
http://simile.mit.edu/mailman/listinfo/general

Re: simple link to target a date on Timeline?

by rlaird :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Josh --

Never mind... I found the:

parseIso8601DateTime(string)

function, and created this:

function centerTimeline(string) {
    tl.getBand(0).setCenterVisibleDate(Timeline.DateTime.parseIso8601DateTime(string));
}

and I call is thus:

<A href='javascript:centerTimeline("1953-05-02")'>May 02 1953</A>

and it works!  Thanks for leading me in the right direction!

  -- Robert


On Thu, Jun 19, 2008 at 9:25 PM, Robert Laird <rlaird@...> wrote:
Josh --

Thanks for the info...  I'm an old hand at HTML, but not as confident around javascript.  If this is a discrete function that I'm calling, don't I have to reference the timeline instance?

Also, none of my XML has an eventID... I have the start, end, title, etc., but no eventID... what is it?

  -- Robert


2008/6/19 Josh Aresty <jaresty@...>:

Hey Robert,

If this is just timeline (e.g. not using Exhibit) then I think what you need is to call timeline.showBubbleForEvent(
"eventID") to scroll directly to and show a bubble for an event. 

If you don't want to show the bubble, then you can write a function that does this:

var evt = timeline.getEventSource().getEvent(eventID);
if (evt) {
 timeline.scrollToCenter(evt.getStart());
}

Josh


2008/6/19 Robert Laird <rlaird@...>:
I've got my timeline up and running on a web page, but would like to put HTML links below it (not part of the js script) that a user can click on and it will move the timeline and zero in on the item they clicked on.  What's the simplest way to do that?

  -- Robert



--
Why did the chicken cross the Mobius strip? To get to the other, er, um....

_______________________________________________
General mailing list
General@...
http://simile.mit.edu/mailman/listinfo/general




--
Best,
Josh Aresty
Systems Administrator/Programmer
MIT LLARC

_______________________________________________
General mailing list
General@...
http://simile.mit.edu/mailman/listinfo/general




--
Why did the chicken cross the Mobius strip? To get to the other, er, um....



--
Why did the chicken cross the Mobius strip? To get to the other, er, um....

_______________________________________________
General mailing list
General@...
http://simile.mit.edu/mailman/listinfo/general

Re: simple link to target a date on Timeline?

by Josh Aresty :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Glad to hear it.  You taught me some new tricks, too :)

Josh

2008/6/19 Robert Laird <rlaird@...>:
Josh --

Never mind... I found the:

parseIso8601DateTime(string)

function, and created this:

function centerTimeline(string) {
    tl.getBand(0).setCenterVisibleDate(Timeline.DateTime.parseIso8601DateTime(string));
}

and I call is thus:

<A href='javascript:centerTimeline("1953-05-02")'>May 02 1953</A>

and it works!  Thanks for leading me in the right direction!

  -- Robert



On Thu, Jun 19, 2008 at 9:25 PM, Robert Laird <rlaird@...> wrote:
Josh --

Thanks for the info...  I'm an old hand at HTML, but not as confident around javascript.  If this is a discrete function that I'm calling, don't I have to reference the timeline instance?

Also, none of my XML has an eventID... I have the start, end, title, etc., but no eventID... what is it?

  -- Robert


2008/6/19 Josh Aresty <jaresty@...>:

Hey Robert,

If this is just timeline (e.g. not using Exhibit) then I think what you need is to call timeline.showBubbleForEvent(
"eventID") to scroll directly to and show a bubble for an event. 

If you don't want to show the bubble, then you can write a function that does this:

var evt = timeline.getEventSource().getEvent(eventID);
if (evt) {
 timeline.scrollToCenter(evt.getStart());
}

Josh


2008/6/19 Robert Laird <rlaird@...>:
I've got my timeline up and running on a web page, but would like to put HTML links below it (not part of the js script) that a user can click on and it will move the timeline and zero in on the item they clicked on.  What's the simplest way to do that?

  -- Robert



--
Why did the chicken cross the Mobius strip? To get to the other, er, um....

_______________________________________________
General mailing list
General@...
http://simile.mit.edu/mailman/listinfo/general




--
Best,
Josh Aresty
Systems Administrator/Programmer
MIT LLARC

_______________________________________________
General mailing list
General@...
http://simile.mit.edu/mailman/listinfo/general




--
Why did the chicken cross the Mobius strip? To get to the other, er, um....



--
Why did the chicken cross the Mobius strip? To get to the other, er, um....

_______________________________________________
General mailing list
General@...
http://simile.mit.edu/mailman/listinfo/general




--
Best,
Josh Aresty
Systems Administrator/Programmer
MIT LLARC
_______________________________________________
General mailing list
General@...
http://simile.mit.edu/mailman/listinfo/general
LightInTheBox - Buy quality products at wholesale price