我想为每个选项卡重命名,名称不同。 其表示标签1,标签2 ....等重命名jQuery UI选项卡
$(function() {
var total_tabs = 0;
// initialize first tab
total_tabs++;
addtab(total_tabs);
$("#addtab, #litab").click(function() {
total_tabs++;
$("#tabcontent p").hide();
addtab(total_tabs);
return false;
});
function addtab(count) {
var closetab = '<a href="" id="close'+count+'" class="close">×</a>';
$("#tabul").append('<li id="t'+count+'" class="ntabs">Tab '+count+' '+closetab+'</li>');
$("#tabcontent").append('<p id="c'+count+'">Tab Content '+count+'</p>');
$("#tabul li").removeClass("ctab");
$("#t"+count).addClass("ctab");
$("#t"+count).bind("click", function() {
$("#tabul li").removeClass("ctab");
$("#t"+count).addClass("ctab");
$("#tabcontent p").hide();
$("#c"+count).fadeIn('slow');
});
$("#close"+count).bind("click", function() {
// activate the previous tab
$("#tabul li").removeClass("ctab");
$("#tabcontent p").hide();
$(this).parent().prev().addClass("ctab");
$("#c"+count).prev().fadeIn('slow');
$(this).parent().remove();
$("#c"+count).remove();
return false;
});
}
});
如何添加对于i创建的每一个翼片重命名功能。 我可以使用弹出框来重命名标签吗?
我想用GUI系统重命名这个,就像下面的链接一样。
http://demo.superdit.com/jquery/dynamic_tab.html
我想将它重命名那里。(通过使用弹出框或东西)
谢谢你......
每个one.It不同意味着所有选项卡每个选项卡名称的基本思路允许在创建标签后更改他们的名字。 有可能吗? – sanbg
让我看看我是否有这个权利,你是否希望能够在创建它们之后编辑标签的名称? – BBog
是的。像那样。 想用接口中的新名称替换它。 – sanbg