Skip to content

Instantly share code, notes, and snippets.

@cherihung
Created March 15, 2013 05:02
Show Gist options
  • Save cherihung/5167606 to your computer and use it in GitHub Desktop.
Save cherihung/5167606 to your computer and use it in GitHub Desktop.
to select by date (month, day, year) and jump to an event in TimelineJS
function jumpTime(type,value) {
var model = VMM.Timeline.DataObj.data_template_obj.timeline.date;
var x = -1; //
$(model).each(function(i,j) {
var currentDate = j.startDate.split('/');
if (currentDate[type] == value ) {
x++;
if (x == 0) {
window.location.hash = i+1 // +1 to accommodate title slide count
}
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment