提问者:小点点

如何在全页图像silder中给出箭头键事件


如何在全页图像滑块中给出箭头键事件,例如下面的示例链接->https://www.htmllion.com/examples/pure-css-based-fullscreen-slider-demo.html。我需要相同的布局与箭头键事件。好心的帮助。


共2个答案

匿名用户

在jQuery中使用键盘事件。根据用户点击导航页面

匿名用户

使用jQuery,您可以执行如下操作。

$(window).on('keyup', function(e){
    console.log(e.keyCode); // log the keycode of the key pressed
    switch(e.keyCode){
        case 37:
            console.log('Prev');
            break;
        case 38:
            console.log('Up');
            break;
        case 39:
            console.log('Next');
            break;
        case 40:
            console.log('Down');
            break;
    }
});