简体   繁体   English

在此示例中是否可以反转下一个和上一个键盘导航?

[英]Is it possible to reverse the next and previous keyboard navigation in this example?

I am creating this html design on an online software called visme. 我正在一个名为visme的在线软件上创建这个html设计。 It is a software that helps create interactive infographics something like canva and allows for a simple Html download.Yey. 它是一个软件,可以帮助创建像canva这样的交互式信息图表,并允许简单的Html下载。是的。

My question is: is it possible to reverse the functions of the navigation key board buttons that navigate through the pages in the code generated by visme that I download? 我的问题是:是否可以反转导航键盘按钮的功能,这些按钮导航我下载的visme生成的代码中的页面?

For example, now the right keyboard key takes you to the next page while the left keyboard key takes you to the previous page. 例如,现在右键盘键将您带到下一页,而左键盘键将您带到上一页。 Is it possible to reverse that where by the left key takes you to the next page while the right key takes you to the previous page? 是否可以通过左键将您带到下一页,而右键带您到上一页?

Here is a link to the code: https://drive.google.com/file/d/1RrslmElWNq57C5W9lyJuWJRIAlGSX5Fi/view?usp=sharing 以下是代码的链接: https//drive.google.com/file/d/1RrslmElWNq57C5W9lyJuWJRIAlGSX5Fi/view?usp=sharing

Yes you can definitely do that. 是的,你绝对可以做到这一点。 jQuery has a predefined keys to their particual value suppose jQuery有一个预定义的密钥,它们的特定值假设

$("body").keydown(function(e) {
  if(e.keyCode == 37) { // left
    $("#showroom").animate({
      left: "-=980"
    });
  }
  else if(e.keyCode == 39) { // right
    $("#showroom").animate({
      left: "+=980"
    });
  }
});

So left key on the keyboard has a value 37 and that for right is 39. 所以键盘上的左键值为37,右键为39。

What you can do is change these value in your jQuery.js file. 你可以做的是在jQuery.js文件中更改这些值。 Refer to the attached jquery.js file from your drive link. 请参阅驱动器链接中附带的jquery.js文件。

在此输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM