getNextStep = function( el ) {
        var steps = document.querySelectorAll( ".step" );
        for ( var i = 0; i < steps.length; i++ ) {
            if ( steps[ i ] === el ) {
                if ( i + 1 < steps.length ) {
                    return steps[ i + 1 ];
                } else {
                    return steps[ 0 ];
                }
            }
        }
    }
Mobile devices support

Allow presentation creators to hide all but 3 slides, to save resources, particularly on mobile
devices, using classes body.impress-mobile, .step.prev, .step.active and .step.next.

Note: This plugin does not take into account possible redirections done with skip, goto etc
plugins. Basically it wouldn't work as intended in such cases, but the active step will at least
be correct.

Adapted to a plugin from a submission by @Kzeni:
https://github.com/impress/impress.js/issues/333