admin管理员组文章数量:1277886
In Jquery I would like to know how to trigger/click an a href... link that's within a .php page. This page is dynamically generating two links that I'd like to trigger using left and right keyboard arrow keys for paging next and back through a site. The links are two images within two divs. I attempted to use this but was unable to get to work due to how the links are being created.
In Jquery I would like to know how to trigger/click an a href... link that's within a .php page. This page is dynamically generating two links that I'd like to trigger using left and right keyboard arrow keys for paging next and back through a site. The links are two images within two divs. I attempted to use this but was unable to get to work due to how the links are being created.
Share Improve this question asked Dec 31, 2009 at 21:28 Derek LernerDerek Lerner 231 silver badge3 bronze badges 02 Answers
Reset to default 8I could do something like this:
$(document).keydown(function(e){
if (e.keyCode == 37) {
alert( "left pressed" );
return false;
}
});
Character codes:
37 - left
38 - up
39 - right
40 - down
$('a').trigger('click');
本文标签: javascriptArrow keys keyboard navigation with JqueryStack Overflow
版权声明:本文标题:javascript - Arrow keys keyboard navigation with Jquery - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741207781a2358493.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论