实现代码如下:

var tabcount = $('#tabs').tabs('tabs').length;修改addTab 方法为:function addTab(subtitle, url, icon) {
var tabcount = $('#tabs').tabs('tabs').length;
if (tabcount <= 5) {
if (!$('#tabs').tabs('exists', subtitle)) {
$('#tabs').tabs('add', {
title: subtitle,
content: createFrame(url),
closable: true,
icon: icon
});
} else {
$('#tabs').tabs('select', subtitle);
$('#mm-refresh').click();
}
} else {
alert('您打开的太多了,请关闭不用的窗口!');
return false;
}

这样允许打开的最大数量为5个(不包括欢迎页)。可根据需要自行修改

以上就是【基本jquery的控制tabs打开的数量的代码】的全部内容了,欢迎留言评论进行交流!

赞(0) 踩(0)

与本文相关的软件

发表我的评论

最新评论

  1. 暂无评论