Examples

Ongoing Periods

Keep a long-running article card visible while its date range still crosses the viewport.

Pin periods already in progress

article.collectOngoing to isToPresent timeline.setOption()

When an article starts before the visible range but ends within or after it, collectOngoing pins its card to the viewport's left edge. This works for periods with a fixed to date and periods marked isToPresent.

const timeline = new Histropedia.Timeline(container, {
  article: {
    collectOngoing: true
  }
});

timeline.load(articles);

// Change the behavior later if needed.
timeline.setOption("article.collectOngoing", false);