Hype Function flickers wallpapers

Im using this code:

So people visiting the site can share specific pages, use the browser navigations buttons and stay in the same scene if they reload the page.

Im also using this code:

That way I can set the background image and video using certain conditions and making the background to stay the same without the scene transitions to interfere: Persistent background dissapearing - #6 by JimScott

BUT

The first one is causing the wallpapers to flicker:
https://dl.dropboxusercontent.com/u/67104790/web/hype_exports/heuristic/broken/broken.html

If I do remove / comment the whole code, the site works just fine:
https://dl.dropboxusercontent.com/u/67104790/web/hype_exports/heuristic/fine/fine.html

To see exactly what I mean, go to "Heuristic" and navigate using the content menu:

If necessary, here you can download the hype file:
https://www.dropbox.com/s/q8k59rfhhlfxhrj/Heuristic_22.zip?dl=0

try this change (just a guess):

var checkHash = function() {
        var hash = window.location.hash.substring(1);
        for (var i = 0; i < hypeDocument.sceneNames().length; i++) {
            if (hypeDocument.sceneNames()[i] == hash && hypeDocument.currentSceneName() != hash) {
                hypeDocument.showSceneNamed(hash);
                break;
            }
        }
    };

    if (window.loadedHashLocation != true) {
        window.loadedHashLocation = true;
        checkHash();
        window.onhashchange = checkHash;
    }

    window.location.hash = "#" + hypeDocument.currentSceneName();
3 Likes

So simple, but it works, you are genius!

I don’t know how users would live without this forum and users like you. I seriously feel bad to ask for so many help with these js scripts but Im thankful there is people willing to help.

1 Like

Amen!

Hans, along the other two "regulars" who are routinely so generous with their time & JavaScript knowledge - @MarkHunte and @DBear - really transform this Forum in to a place of learning. Reading books & sleuthing through the Internet are valuable resources, but to have this level of JavaScript input~insight to questions that directly concern animating content with Hype is really extraordinary!

Gentlemen - Thank You so much!



I seriously feel bad to ask for so many help

@Davirus It is with questions like yours that we all get to learn - isn't that part of what this Forum is about? (No one has to answer if they don't want to.)

1 Like