2017-04-12 155 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"); 
};