开发者

How to control links and navigation in a website using arrow keys (without using flash)?

开发者 https://www.devze.com 2023-01-07 08:42 出处:网络
In this website, an anchor link (right blue arrow) is activated with the right arrow key. I\'m not sure if a new page is loaded when that anchor link is activated.

In this website, an anchor link (right blue arrow) is activated with the right arrow key. I'm not sure if a new page is loaded when that anchor link is activated.

How can I accomplish that effect?

The page also goes to the top 开发者_如何学Pythonwhen the up (upper?) arrow key is pressed. How can I accomplish that too?


It's all done through javascript. I didn't look too far into the pages javascript files but the basic concept is to use the javascript onkeypress event to call a change to the current url. This can also be done with jquery .keypress() if you want to use that instead. The same idea goes for the up arrow key function which would possibly just press the page up key for you which can be done with the sendkeys method.

0

精彩评论

暂无评论...
验证码 换一张
取 消