我正在尝试让我的Jquery Ui accordion以一种最初只能打开accordion的第一个选项卡的方式工作。单击第一个accordion选项卡时,第二个选项卡变为可打开(clickable),依此类推,一直到7。
我已经将折叠选项卡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找到
预先感谢您的所有帮助:)
发布于 2017-04-12 23:12:51
如果您使用的是jQuery,请完全坚持使用它
$(".ui-accordion-header").click(function() {
var nextId = $(this).attr("id").split('-').pop();
$("#ui-id-" + nextId).css("pointer-events","auto");
};https://stackoverflow.com/questions/43372909
复制相似问题