我有一个动态选项卡,我想在其中显示 HTML DIV。现在,在第一次单击时,我可以看到动态选项卡内的 HTML DIV。但是,如果关闭一次并通过单击超链接再次重新打开,则意味着打开此选项卡Tab,这次我不会得到它..我不知道这里发生了什么..
这是代码..
function addTab(title) {
if ($('#tt').tabs('exists', title)) {
$('#tt').tabs('select', title);
} else {
if (title == "Check in List") {
var content = $("#checkinuserform");
}
else {
var content = '<p>Hii</p>';
}
$('#tt').tabs('add', {
title: title,
content: content,
closable: true
});
}
}
代码中的checkinuserform
是HTML DIV id..
请帮助我..谢谢..
最佳答案
您是否尝试克隆 div:
var content = $("#checkinuserform").clone();
关于javascript - 动态选项卡的奇怪行为,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26648001/