【问题标题】:AddClass to a keyboard shortcut anchor for feedbackAddClass 到键盘快捷键锚点以获取反馈
【发布时间】:2013-06-06 02:51:39
【问题描述】:

我想简单地为我设置了键盘快捷键的锚链接添加一些 CSS。菜单项。

<a id="about">About The Company</a>

shortcut.add("a",function() {
    $("#about").trigger('click');  
    },{
    'disable_in_input':true
});

When the keyboard 'a' is selected, I want to get the "About The Company" anchor to fade into red for a second to give the user feedback that it has been selected.

这是我正在使用的脚本,仅供参考:http://www.openjs.com/scripts/events/keyboard_shortcuts/

【问题讨论】:

    标签: javascript jquery keyboard-shortcuts addclass


    【解决方案1】:
    shortcut.add("a",function() {
        $("#about").hide().css('color','#ff0000').fadeIn(700);
    });
    

    【讨论】:

    • 谢谢。这增加了 CSS,但我只希望它保持一秒钟并恢复正常颜色。所以它会淡入(等一下)..淡出。这可能吗?
    猜你喜欢
    • 1970-01-01
    • 2021-06-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多