Skip to content
This repository has been archived by the owner on Feb 17, 2021. It is now read-only.

Example of keyboard support to navigate between steps #8

Closed
rwinikates opened this issue Jul 1, 2013 · 1 comment
Closed

Example of keyboard support to navigate between steps #8

rwinikates opened this issue Jul 1, 2013 · 1 comment

Comments

@rwinikates
Copy link

It is not pretty, but it adds support for left and right keys to go to the previous and next steps respectively. Add this to your tour options:

  onStart: function(){
    document.onkeydown = checkKey;

    function checkKey(e) {

        e = e || window.event;

        if (e.keyCode == '37') {
            hopscotch.prevStep()
        }
        else if (e.keyCode == '39') {
            hopscotch.nextStep()
        }
    }
  },
@rwinikates
Copy link
Author

No particular action needed, just documenting here for others.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant