How to scroll two timelines in two file in one page?


(Alex) #1

Hello,

I can scroll timelines in one Hype file by using:

window.onscroll = function () {
	
	var scrollAmount = scrollY;
	hypeDocument.goToTimeInTimelineNamed(scrollAmount * 0.006, 'timelineprodcut')
        hypeDocument.goToTimeInTimelineNamed(scrollAmount * 0.006, 'timelineprodcut2')

}

like this one https://www.lovcour.com/one-productscroll-timeline

But, if put these two timelines animation into two hype files, and put two animations into one page, both of them will not work, and you may check the test page at:

https://www.lovcour.com/twoproductscrolltest

Anyway to make them work please? Thanks

Alex


Hype GlobalBehavior (Custom Behavior Extension)
(Hans-Gerd Claßen) #2

via js-library:

or here:
https://tumult.com/hype/documentation/3.0/#invoking-api-from-outside-oftumult-hype


(Alex) #3

Thanks, I will have a try:)

Alex