Hi Polyboom,

You'd need to write a javascript for your html file that would parse the 
document's "search" property.
The "search" property is the question mark and what follows from your 
document's location url.

Eg,  in js, try
alert (window.location.search)
See http://www.w3schools.com/HTMLDOM/prop_loc_search.asp

If your file is called as   

   http://www.yourdomain.com/timeline.html?cDate=1500

then window.location.search ==  "?cDate=1500"

You would then parse the string, then call centerTimeline with the results.

Tips:
1) urls must be encoded, they can't contain spaces. See 
http://www.blooberry.com/indexdot/html/topics/urlencoding.htm
So you should carefully define the date time format that you will be parsing.
Eg, use the iso 8601 date format since it doesn't use spaces.
See http://www.w3.org/TR/NOTE-datetime

And the Timeline Ajax library already includes a parser for it!

2) Handle the case where no search was specified. And be sure to test on 
multiple browsers.

3) Look in the timeline-api file, it parses its seach property as described 
above.

Please send us your completed javascript, it will help other people too.

Hoped this helped,

Larry




________________________________
From: polyboom <[email protected]>
To: SIMILE Widgets <[email protected]>
Sent: Wednesday, March 4, 2009 10:29:59 AM
Subject: Center timeline via extern link


Centering the timeline with javascript

<A href="javascript:centerTimeline(500);">500 n. Chr.</A>

and

function centerTimeline(date) {
    tl.getBand(0).setCenterVisibleDate
(Timeline.DateTime.parseGregorianDateTime(date));

}

just works great but i wonder how can it is possible to center the
timeline from an extern link

http://www.yourdomain.com/timeline.html?cDate=1500

calling a script

<script type="text/javascript">

centerTimeline(GetVariableWithDate);

</script>

wont work. Any Ideas?


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