質問

How can you stop the keyboard from affecting an Accordion? Because I use a Netbook, i find myself consistently navigating around the web pages, with the arrow keys.

When the Accordion is in focus, I find myself cycling through the different accordion headers (not even content sections.)

I had a similar issue with Jquery tabs which was fixed with

$(function() {
    $(".tabs").tabs({
      active: 0,
        show: {
            opacity:'toggle',
            duration:'fast'
        }
    });

    // getter
    var show = $(".selector").tabs("option", "show");

    // setter
    $(".selector").tabs("option", "show", {
        opacity:'toggle',
        duration: 'normal'
    });
    **$(".tabs li[role=tab]").unbind('keydown');**
});

I tried the following code which didn't seam to work.

$('.accordion').unbind('keydown')

Has anyone got any ideas on this?

Thanks

Edited to add in my stripped down accordion..

<div class="accordion">
    <a href="#"><div class="accordion_head">About</div></a>
        <div class="accordion_content">
        </div>
    <a href="#"><div class="accordion_head">Interests</div></a>
        <div class="accordion_content">
        </div>
    <a href="#"><div class="accordion_head">Highlights</div></a>
        <div class="accordion_content">
        </div>
</div>
役に立ちましたか?

解決

Try this:

$(".ui-accordion [role=tab]").unbind('keydown');
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top