使用空格键切换禁用 jQuery UI Accordion [英] Disabling jQuery UI Accordion with space bar toggling

查看:31
本文介绍了使用空格键切换禁用 jQuery UI Accordion的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 jQuery UI 手风琴中看到您可以使用空格键来切换活动标题.如何禁用此功能?我不希望用户使用键盘与手风琴进行交互.

I see in jQuery UI accordian you can use the space bar to toggle active headers. How can one disable this? I don't want the user to use keyboard to interact with the accordion.

推荐答案

如果你根本不需要_keydown"功能,我想你可以删除它.

if you don't need the "_keydown" function at all, I guess you can just delete it.

delete($.ui.accordion.prototype._keydown);

如果你想改变或覆盖_keydown"函数的功能并且不想将其破解到您可以执行的原始文件中:

if you want to change or override the functionality of the "_keydown" function and don't want to hack it into the original file you could do:

$.ui.accordion.prototype._keydown = function( event ) {
    // your new code for the "_keydown" function
};

希望有帮助

这篇关于使用空格键切换禁用 jQuery UI Accordion的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆