Deactivating actions during scrolling using a finger

I purchased Hype Pro some weeks ago and I am really happy with it.

Scrolling/Moving a site from top to down or from left to right using a finger on a mobile device the defined scene actions should be deactivated. Could somebody give me the information what I need to do to realize this.

Thank You
Peter

Hi Peter,

Welcome to Hype Pro!

You need to elaborate a little more on the “scene actions” perhaps also .zip up a document and share by dragging into the message window.

That way we can see what you need rather than try to guess.

If you’re looking to disable the “rubberband” scrolling of a page, you can add this code to an On Scene Load event for your first scene (or modify it to run in the script head if that doesn’t suit your purpose):

	var preventScroll = function (event) {
		event.stopPropagation();
		event.preventDefault();
	}
	var docElement = hypeDocument.getElementById(hypeDocument.documentId());
	
	if(docElement.addEventListener) {
		docElement.addEventListener('touchmove', preventScroll, true);
	}	
2 Likes

Dear Jonathan,

the possibility of scrolling a page I want to keep. Just during scrolling of a page using a finger on a mobile device the scene actions should be deactivated. After finishing the scrolling the scene actions should be activated again.

At the moment during scrolling a page using a finger and touching a jpg with a ‘go to scene x’ command I am going directly to this scene.

A ‘go to a scene x’ command should be activated after finishing the scrolling.

Using a mouse everything is working fine. But using a finger at the touch screen not. I hope you understand my problem.

Kind regards
Peter

If you uncheck 'Use Touch Events' in the Document Inspector this will increase the delay between when the touchstart action occurs and when the related action occurs. This might have other consequences which you can get more background info on here: Tumult Hype Documentation

1 Like

Leaving a reply here in case it may help others. Unfortunately this script didn't appear to work for me on ipad OS 14.1, however the script Dan posted here works for me:

1 Like