2017-04-12 156 views
0

我想让我的Jquery Ui手风琴以最初只能打开手风琴的第一个选项卡的方式工作。点击第一个手风琴标签,第二个变成可打开(可点击)等等。一直到7。jquery ui手风琴的指针事件

我已经将手风琴标签2-7的pointer events设置为none。然后我尝试使用下面的代码:

$(".ui-accordion-header:nth-of-type(1)").onclick = function() { 
    $(".ui-accordion-header:nth-of-type(2)").style.pointerEvents = "auto"; 
}; 

这很不幸没有工作,我不确定是什么问题。该网页的链接,我的工作就可以发现here

预先感谢您所有的帮助:)

回答

1

如果您正在使用jQuery坚持下去完全

$(".ui-accordion-header").click(function() { 
    var nextId = $(this).attr("id").split('-').pop(); 
    $("#ui-id-" + nextId).css("pointer-events","auto"); 
};