Targeting a timeline in another app

I am using a Hype navigation bar placed in a website created in another application. I would like the current web page to be highlighted in the Hype navigation bar. I assume I could do this by targeting a timeline associated with current web page name and then pausing. Any idea what code I could use to achieve this?

You can get the current web page by running JavaScript ‘on scene load’. The script below runs a timeline if the HTML page on which the document is loaded is ‘index.html’:

var sPath = window.location.pathname;
var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);

if (sPage == 'index.html'){
	hypeDocument.startTimelineNamed('IndexTimeline', hypeDocument.kDirectionForward)
}

The hypeDocument.startTimelineNamed('IndexTimeline', hypeDocument.kDirectionForward) portion of the above script could potentially run a timeline which highlights the current page.

1 Like