0

http://www.madeinebor.com/themes/sliddr/index.htm#/logo

As you see this website works by pressing space bar and some other keys, how can I change it to clicking. So when ever the user click in empty area, it navigate to next step. Or if thats not possible what about making a box in the side so the user click on that box to navigate?

here is the navigation part of the code:

// Prevent default keydown action when one of supported key is pressed.
    document.addEventListener("keydown", function ( event ) {
        if ( event.keyCode === 9 || ( event.keyCode >= 32 && event.keyCode <= 34 ) || (event.keyCode >= 37 && event.keyCode <= 40) ) {
            event.preventDefault();
        }
    }, false);

And

document.addEventListener("keyup", function ( event ) {
        if ( event.keyCode === 9 || ( event.keyCode >= 32 && event.keyCode <= 34 ) || (event.keyCode >= 37 && event.keyCode <= 40) ) {
            switch( event.keyCode ) {
                case 33: // pg up
                case 37: // left
                case 38: // up
                         api.prev();
                         break;
                case 9:  // tab
                case 32: // space
                case 34: // pg down
                case 39: // right
                case 40: // down
                         api.next();
                         break;
            }

            event.preventDefault();
        }
    }, false);
Alex Jj
  • 1,343
  • 10
  • 19
  • 30
  • What did you try? What are you having trouble with? – SLaks May 19 '13 at 02:24
  • @SLaks Well tbh I have no idea how to do it. So I only know that its something about this part of the code. And as I explained I'd like to use click instead of Space bar to browse the page. So how to do it? – Alex Jj May 19 '13 at 03:04
  • You need to handle the click event and write code. – SLaks May 19 '13 at 03:04
  • @SLaks well thats why I posted it here :) – Alex Jj May 19 '13 at 03:17
  • StackOverflow generally expects you to put in some effort (learn how to write Javascript and handle events) – SLaks May 19 '13 at 03:18

0 Answers0