Dynamically Prevent Page Turn to Next Page

After some guidance from @jonathan and some code from the Hype Extension project by @MarkHunte, you can disable the scene swipe action on a specific scene by running this function ‘On Scene Load’:

sceneElement.style.setProperty("pointer-events", "none", "important"); on the scene element, so the full code would be:

    var sceneElement;
    //-- get current scene
    var hypeContainer = document.getElementById(hypeDocument.documentId());
    var sceneArray = hypeContainer.getElementsByClassName("HYPE_scene");
    for (i = 0; i < sceneArray.length; i++) {
        if (sceneArray[i].style.display === "block") sceneElement = sceneArray[i];    
    }
    
    sceneElement.style.setProperty("pointer-events", "none", "important");
2 Likes