Skip to content

ifvisible.OnEvery doesn't continue after switching tabs #45

Open
@khaledosman

Description

@khaledosman

version: 2.0.10

I have the current code

ifvisible.setIdleDuration(900);

    ifvisible.idle(function() {
        console.log('idle')
        document.body.style.opacity = 0.5;
    });

    ifvisible.wakeup(function() {
        console.log('wakeup')
        document.body.style.opacity = 1;
    });

    // instead of setInterval, this will not call the callback if the user is idle
    ifvisible.onEvery(5, function() {
        console.log('interval');
    });

the interval initially gets called correctly, if I switch tabs then get back to the page "wakeup" is fired however the interval doesn't resume

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions