Play timeline when users scrolls to the end of HTML widget (iframe)

Hi I am trying to play a timeline when a user scrolls to the bottom on a HTML widget (iframe). I can achieve this with the document but not with an iframe. Any help getting this to work for an iframe within an HTML widget greatly appreciated.

window.onscroll = function () {
		
		var scrollAmount = scrollY;
		
		console.log (scrollY);
		
		if (scrollY > 1500){
		
		// do something

		}

	}

This code would need to be within the HTML widget's code, since the parent (the Hype document) can't listen to that frame's scroll position. (That is, without postmessage information shared between the two)

Here's more info on that postmessage workflow with some code samples:

1 Like

Thanks for the reply Daniel! gives me a bit of direction many thanks

1 Like