Skip to content

动态化的bootstrap tabs,支持动态加载、关闭、刷新等

Notifications You must be signed in to change notification settings

adieUkid/bootstrap-dynamic-tab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

bootstrap-dynamic-tab

动态化的bootstrap tabs,支持动态加载、关闭、刷新等

Example

使用

引用顺序:

  1. jQuery
  2. bootstrap3
  3. bootstrap.dynamic-tab.js

HTML:

<ul class="nav nav-tabs"></ul>
<div class="tab-content"></div>

JS:

$(function(){
    $.fn.tab.addTab({
        url: '/page1.html'
    })
})

方法

  1. 刷新当前页
$.fn.tab.refreshCurrent()
  1. 关闭当前页
$.fn.tab.closeCurrent()

参数详解

$.fn.tab.addTab({
    containerId: 'container-id',            //容器Id,默认为"body"
    tabId: 'new-tab-id',                    //自定义tabId
    tabName: '新页面',                       //自定义tab名称
    url: '/page2.html',                     //tab页面加载地址
    closable: false,                        //是否显示"关闭"按钮
    callback: function(tabId, paneId, $pane){
        $pane.find('.name').text('默认')     //加载完毕的回调函数,用于初始化页面
    }
})

About

动态化的bootstrap tabs,支持动态加载、关闭、刷新等

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published