精品久久久久久亚洲精品_成人午夜网站_www日本高清_亚洲精品久久久久午夜福

導航和選項卡(Navs & tabs)

有關如何使用 Bootstrap附帶的導航組件的文檔和示例。

基礎導航

Bootstrap 中可用的導航共享常規標記和樣式,從base.nav類到活動和禁用狀態。交換修改器類以在每個樣式之間切換。

Nav組件是用FlexBox構建的,為構建所有類型的導航組件提供了堅實的基礎。它包括一些樣式覆蓋(用于處理列表)、一些鏈接填充(用于較大的命中區域)和基本的禁用樣式。

基礎導航組件不包括任何.active狀態。下面的例子包括這個類,主要是為了證明這個特定的類不會觸發任何特殊的樣式。

要將活動狀態傳遞給輔助技術,請使用aria-current屬性-使用當前頁面的頁面值,或使用集合中當前項的true。

<ul class="nav">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">Active</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a>
</li>
</ul>

class可以使用在很多地方,因此您的標記可以超級靈活。如果項目的順序很重要,可以使用與ul類似的ol,或者使用nav元素。因為.nav使用display: flex,因此nav-link與nav-item的行為一樣,卻不需要有額外的標記。

<nav class="nav">
<a class="nav-link active" aria-current="page" href="#">Active</a>
<a class="nav-link" href="#">Link</a>
<a class="nav-link" href="#">Link</a>
<a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a>
</nav>

可用樣式

使用修飾符、通用類別更改.nav元件的樣式。依據需要混合搭配或自行建立。

水平對齊

使用flexbox通用類別更改導航的水平對齊方式。預設情況下導航會向左對齊,但您可以輕松地將其更改為向中心或向右對齊。

使用.justify-content-center置中對齊:

<ul class="nav justify-content-center">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">Active</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a>
</li>
</ul>

使用.justify-content-end靠右對齊:

<ul class="nav justify-content-end">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">Active</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a>
</li>
</ul>

垂直

通過使用.flex-column通用類別更改flex的軸線方向以堆疊導航。如果只希望在特定的viewports下堆疊,可使用響應式版本(例如.flex-sm-column)。

<ul class="nav flex-column">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">Active</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a>
</li>
</ul>

像往常一樣,垂直導航也可以不用ul。

<nav class="nav flex-column">
<a class="nav-link active" aria-current="page" href="#">Active</a>
<a class="nav-link" href="#">Link</a>
<a class="nav-link" href="#">Link</a>
<a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a>
</nav>

選項卡

使用基本的導航,并加入.nav-tabs以生成具有分頁標簽的界面。透過我們的分頁JavaScript插件來創造可切換的塊。

<ul class="nav nav-tabs">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">Active</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a>
</li>
</ul>

膠囊

使用相同的HTML,但使用.nav-pills取代:

<ul class="nav nav-pills">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">Active</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a>
</li>
</ul>

填充并對齊

.nav內容有兩種寬度擴展用的Class,使用.nav-fill會將.nav-item內容按照比例分配空間。注意,這會占用所有的水平空間,但并不是每個導航項目都具有相同寬度。

<ul class="nav nav-pills nav-fill">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">Active</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Much longer nav link</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a>
</li>
</ul>

當使用nav導航時,您可以忽略.nav-item,因為客制化a元素的樣式僅需要.nav-link。

<nav class="nav nav-pills nav-fill">
<a class="nav-link active" aria-current="page" href="#">Active</a>
<a class="nav-link" href="#">Much longer nav link</a>
<a class="nav-link" href="#">Link</a>
<a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a>
</nav>

創建等寬元素請使用.nav-justified。所有的水平空間將被導航連接占據,但與上面的.nav-fill不同,每個導航項都將是相同的寬度。

<ul class="nav nav-pills nav-justified">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">Active</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Much longer nav link</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a>
</li>
</ul>

與使用nav導航中的.nav-fill示例類似。

<nav class="nav nav-pills nav-justified">
<a class="nav-link active" aria-current="page" href="#">Active</a>
<a class="nav-link" href="#">Much longer nav link</a>
<a class="nav-link" href="#">Link</a>
<a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a>
</nav>

使用flex實用程序

如果需要響應式的導航變化,請使用一系列flexbox通用類別。這些通用類別在斷點之間提供更多的自定義設定。在下面的示例中,我們的導航將在最小斷點以下堆疊,并從small斷點開始采用水平排版以填滿所有可用寬度。

<nav class="nav nav-pills flex-column flex-sm-row">
<a class="flex-sm-fill text-sm-center nav-link active" aria-current="page" href="#">Active</a>
<a class="flex-sm-fill text-sm-center nav-link" href="#">Longer nav link</a>
<a class="flex-sm-fill text-sm-center nav-link" href="#">Link</a>
<a class="flex-sm-fill text-sm-center nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a>
</nav>

關于可訪問性

如果您是將導航當作導航條使用,那么請務必確保在符合邏輯的ul之父容器上加入role=“navigation”,或使用nav元素包裝整個導航條。不要在ul本身添加role,因為這樣做將會阻止輔助技術將其聲明為列表。

請注意,即使導航條的視覺樣式透過.nav-tabs而呈現為分頁標簽,也應該不會被賦予role=“tablist”,role=“tab”或role=“tabpanel”屬性。這些僅適用于動態分頁標簽界面,如WAI ARIA Authoring Practices中描述。相關示例,請參閱本節中的JavaScript behavior。在動態選項界面上不需要aria-current屬性,因為我們的JavaScript透過在活動頁簽上添加aria-selected=“true”來處理標明狀態。

使用下拉列表

加入額外的HTML和下拉菜單JavaScript插件

帶下拉列表的選項卡

<ul class="nav nav-tabs">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">Active</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button" aria-expanded="false">Dropdown</a>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="#">Action</a></li>
<li><a class="dropdown-item" href="#">Another action</a></li>
<li><a class="dropdown-item" href="#">Something else here</a></li>
<li><hr class="dropdown-divider"></li>
<li><a class="dropdown-item" href="#">Separated link</a></li>
</ul>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a>
</li>
</ul>

帶下拉列表的膠囊

<ul class="nav nav-pills">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">Active</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button" aria-expanded="false">Dropdown</a>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="#">Action</a></li>
<li><a class="dropdown-item" href="#">Another action</a></li>
<li><a class="dropdown-item" href="#">Something else here</a></li>
<li><hr class="dropdown-divider"></li>
<li><a class="dropdown-item" href="#">Separated link</a></li>
</ul>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a>
</li>
</ul>

Sass

Variables

$nav-link-padding-y:                .5rem;
$nav-link-padding-x:                1rem;
$nav-link-font-size:                null;
$nav-link-font-weight:              null;
$nav-link-color:                    null;
$nav-link-hover-color:              null;
$nav-link-transition:               color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out;
$nav-link-disabled-color:           $gray-600;

$nav-tabs-border-color:             $gray-300;
$nav-tabs-border-width:             $border-width;
$nav-tabs-border-radius:            $border-radius;
$nav-tabs-link-hover-border-color:  $gray-200 $gray-200 $nav-tabs-border-color;
$nav-tabs-link-active-color:        $gray-700;
$nav-tabs-link-active-bg:           $body-bg;
$nav-tabs-link-active-border-color: $gray-300 $gray-300 $nav-tabs-link-active-bg;

$nav-pills-border-radius:           $border-radius;
$nav-pills-link-active-color:       $component-active-color;
$nav-pills-link-active-bg:          $component-active-bg;

JavaScript行為

使用JavaScript分頁標簽插件-單獨或透過編譯的bootstrap.js檔-擴展我們的導航分頁標簽和膠囊狀分頁,以創建可選的分頁標簽、甚至是下拉菜單。

態頁簽界面,如WAI ARIA Authoring Practices所描述,需要role=“tablist”、role=“tab”,role=“tabpanel”和附加的aria-屬性,向用戶提供輔助技術(如屏幕閱讀器)的結構、功能和當前狀態。

請注意,動態頁簽應該不包含下拉菜單,因為這會導致可用性和親和性問題。從可用性的角度來看,當前顯示的選項卡的觸發器元素不會立即顯示(因為它在關閉的下拉菜單中)可能會導致混淆。從親和性的角度來看,目前還沒有明確的方式將這種結構對應到標準的WAI ARIA模式,這意味著不能容易地被用戶的輔助技術所理解。

Placeholder content for the tab panel. This one relates to the home tab. Takes you miles high, so high, 'cause she’s got that one international smile. There's a stranger in my bed, there's a pounding in my head. Oh, no. In another life I would make you stay. ‘Cause I, I’m capable of anything. Suiting up for my crowning battle. Used to steal your parents' liquor and climb to the roof. Tone, tan fit and ready, turn it up cause its gettin' heavy. Her love is like a drug. I guess that I forgot I had a choice.

Placeholder content for the tab panel. This one relates to the profile tab. You got the finest architecture. Passport stamps, she's cosmopolitan. Fine, fresh, fierce, we got it on lock. Never planned that one day I'd be losing you. She eats your heart out. Your kiss is cosmic, every move is magic. I mean the ones, I mean like she's the one. Greetings loved ones let's take a journey. Just own the night like the 4th of July! But you'd rather get wasted.

Placeholder content for the tab panel. This one relates to the contact tab. Her love is like a drug. All my girls vintage Chanel baby. Got a motel and built a fort out of sheets. 'Cause she's the muse and the artist. (This is how we do) So you wanna play with magic. So just be sure before you give it all to me. I'm walking, I'm walking on air (tonight). Skip the talk, heard it all, time to walk the walk. Catch her if you can. Stinging like a bee I earned my stripes.

<ul class="nav nav-tabs" id="myTab" role="tablist">
<li class="nav-item" role="presentation">
<button class="nav-link active" id="home-tab" data-bs-toggle="tab" data-bs-target="#home" type="button" role="tab" aria-controls="home" aria-selected="true">Home</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link" id="profile-tab" data-bs-toggle="tab" data-bs-target="#profile" type="button" role="tab" aria-controls="profile" aria-selected="false">Profile</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link" id="contact-tab" data-bs-toggle="tab" data-bs-target="#contact" type="button" role="tab" aria-controls="contact" aria-selected="false">Contact</button>
</li>
</ul>
<div class="tab-content" id="myTabContent">
<div class="tab-pane fade show active" id="home" role="tabpanel" aria-labelledby="home-tab">...</div>
<div class="tab-pane fade" id="profile" role="tabpanel" aria-labelledby="profile-tab">...</div>
<div class="tab-pane fade" id="contact" role="tabpanel" aria-labelledby="contact-tab">...</div>
</div>

為了滿足您的需求,它可以與基于ul的標簽(如上所示)一起使用,也可以與任意“roll your own”標記一起使用。請注意,如果您使用的是nav,則不應直接向其中添加role=“tablist”,因為這會復寫該元素原生的role。取而代之的是,切換到其他元素(在下面的示例中為簡單的div),然后用nav包裝起來。

Placeholder content for the tab panel. This one relates to the home tab. Takes you miles high, so high, 'cause she’s got that one international smile. There's a stranger in my bed, there's a pounding in my head. Oh, no. In another life I would make you stay. ‘Cause I, I’m capable of anything. Suiting up for my crowning battle. Used to steal your parents' liquor and climb to the roof. Tone, tan fit and ready, turn it up cause its gettin' heavy. Her love is like a drug. I guess that I forgot I had a choice.

Placeholder content for the tab panel. This one relates to the profile tab. You got the finest architecture. Passport stamps, she's cosmopolitan. Fine, fresh, fierce, we got it on lock. Never planned that one day I'd be losing you. She eats your heart out. Your kiss is cosmic, every move is magic. I mean the ones, I mean like she's the one. Greetings loved ones let's take a journey. Just own the night like the 4th of July! But you'd rather get wasted.

Placeholder content for the tab panel. This one relates to the contact tab. Her love is like a drug. All my girls vintage Chanel baby. Got a motel and built a fort out of sheets. 'Cause she's the muse and the artist. (This is how we do) So you wanna play with magic. So just be sure before you give it all to me. I'm walking, I'm walking on air (tonight). Skip the talk, heard it all, time to walk the walk. Catch her if you can. Stinging like a bee I earned my stripes.

<nav>
<div class="nav nav-tabs" id="nav-tab" role="tablist">
<button class="nav-link active" id="nav-home-tab" data-bs-toggle="tab" data-bs-target="#nav-home" type="button" role="tab" aria-controls="nav-home" aria-selected="true">Home</button>
<button class="nav-link" id="nav-profile-tab" data-bs-toggle="tab" data-bs-target="#nav-profile" type="button" role="tab" aria-controls="nav-profile" aria-selected="false">Profile</button>
<button class="nav-link" id="nav-contact-tab" data-bs-toggle="tab" data-bs-target="#nav-contact" type="button" role="tab" aria-controls="nav-contact" aria-selected="false">Contact</button>
</div>
</nav>
<div class="tab-content" id="nav-tabContent">
<div class="tab-pane fade show active" id="nav-home" role="tabpanel" aria-labelledby="nav-home-tab">...</div>
<div class="tab-pane fade" id="nav-profile" role="tabpanel" aria-labelledby="nav-profile-tab">...</div>
<div class="tab-pane fade" id="nav-contact" role="tabpanel" aria-labelledby="nav-contact-tab">...</div>
</div>

標簽分頁插件也能使用于膠囊狀頁簽。

Placeholder content for the tab panel. This one relates to the home tab. Takes you miles high, so high, 'cause she’s got that one international smile. There's a stranger in my bed, there's a pounding in my head. Oh, no. In another life I would make you stay. ‘Cause I, I’m capable of anything. Suiting up for my crowning battle. Used to steal your parents' liquor and climb to the roof. Tone, tan fit and ready, turn it up cause its gettin' heavy. Her love is like a drug. I guess that I forgot I had a choice.

Placeholder content for the tab panel. This one relates to the profile tab. You got the finest architecture. Passport stamps, she's cosmopolitan. Fine, fresh, fierce, we got it on lock. Never planned that one day I'd be losing you. She eats your heart out. Your kiss is cosmic, every move is magic. I mean the ones, I mean like she's the one. Greetings loved ones let's take a journey. Just own the night like the 4th of July! But you'd rather get wasted.

Placeholder content for the tab panel. This one relates to the contact tab. Her love is like a drug. All my girls vintage Chanel baby. Got a motel and built a fort out of sheets. 'Cause she's the muse and the artist. (This is how we do) So you wanna play with magic. So just be sure before you give it all to me. I'm walking, I'm walking on air (tonight). Skip the talk, heard it all, time to walk the walk. Catch her if you can. Stinging like a bee I earned my stripes.

<ul class="nav nav-pills mb-3" id="pills-tab" role="tablist">
<li class="nav-item" role="presentation">
<button class="nav-link active" id="pills-home-tab" data-bs-toggle="pill" data-bs-target="#pills-home" type="button" role="tab" aria-controls="pills-home" aria-selected="true">Home</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link" id="pills-profile-tab" data-bs-toggle="pill" data-bs-target="#pills-profile" type="button" role="tab" aria-controls="pills-profile" aria-selected="false">Profile</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link" id="pills-contact-tab" data-bs-toggle="pill" data-bs-target="#pills-contact" type="button" role="tab" aria-controls="pills-contact" aria-selected="false">Contact</button>
</li>
</ul>
<div class="tab-content" id="pills-tabContent">
<div class="tab-pane fade show active" id="pills-home" role="tabpanel" aria-labelledby="pills-home-tab">...</div>
<div class="tab-pane fade" id="pills-profile" role="tabpanel" aria-labelledby="pills-profile-tab">...</div>
<div class="tab-pane fade" id="pills-contact" role="tabpanel" aria-labelledby="pills-contact-tab">...</div>
</div>

還有搭配垂直膠囊狀頁簽。

Placeholder content for the tab panel. This one relates to the home tab. Saw you downtown singing the Blues. Watch you circle the drain. Why don't you let me stop by? Heavy is the head that wears the crown. Yes, we make angels cry, raining down on earth from up above. Wanna see the show in 3D, a movie. Do you ever feel, feel so paper thin. It’s a yes or no, no maybe.

Placeholder content for the tab panel. This one relates to the profile tab. Takes you miles high, so high, 'cause she’s got that one international smile. There's a stranger in my bed, there's a pounding in my head. Oh, no. In another life I would make you stay. ‘Cause I, I’m capable of anything. Suiting up for my crowning battle. Used to steal your parents' liquor and climb to the roof. Tone, tan fit and ready, turn it up cause its gettin' heavy. Her love is like a drug. I guess that I forgot I had a choice.

Placeholder content for the tab panel. This one relates to the messages tab. You got the finest architecture. Passport stamps, she's cosmopolitan. Fine, fresh, fierce, we got it on lock. Never planned that one day I'd be losing you. She eats your heart out. Your kiss is cosmic, every move is magic. I mean the ones, I mean like she's the one. Greetings loved ones let's take a journey. Just own the night like the 4th of July! But you'd rather get wasted.

Placeholder content for the tab panel. This one relates to the settings tab. Her love is like a drug. All my girls vintage Chanel baby. Got a motel and built a fort out of sheets. 'Cause she's the muse and the artist. (This is how we do) So you wanna play with magic. So just be sure before you give it all to me. I'm walking, I'm walking on air (tonight). Skip the talk, heard it all, time to walk the walk. Catch her if you can. Stinging like a bee I earned my stripes.

<div class="d-flex align-items-start">
<div class="nav flex-column nav-pills me-3" id="v-pills-tab" role="tablist" aria-orientation="vertical">
<button class="nav-link active" id="v-pills-home-tab" data-bs-toggle="pill" data-bs-target="#v-pills-home" type="button" role="tab" aria-controls="v-pills-home" aria-selected="true">Home</button>
<button class="nav-link" id="v-pills-profile-tab" data-bs-toggle="pill" data-bs-target="#v-pills-profile" type="button" role="tab" aria-controls="v-pills-profile" aria-selected="false">Profile</button>
<button class="nav-link" id="v-pills-messages-tab" data-bs-toggle="pill" data-bs-target="#v-pills-messages" type="button" role="tab" aria-controls="v-pills-messages" aria-selected="false">Messages</button>
<button class="nav-link" id="v-pills-settings-tab" data-bs-toggle="pill" data-bs-target="#v-pills-settings" type="button" role="tab" aria-controls="v-pills-settings" aria-selected="false">Settings</button>
</div>
<div class="tab-content" id="v-pills-tabContent">
<div class="tab-pane fade show active" id="v-pills-home" role="tabpanel" aria-labelledby="v-pills-home-tab">...</div>
<div class="tab-pane fade" id="v-pills-profile" role="tabpanel" aria-labelledby="v-pills-profile-tab">...</div>
<div class="tab-pane fade" id="v-pills-messages" role="tabpanel" aria-labelledby="v-pills-messages-tab">...</div>
<div class="tab-pane fade" id="v-pills-settings" role="tabpanel" aria-labelledby="v-pills-settings-tab">...</div>
</div>
</div>

使用數據屬性

只需在元素上指定data-bs-toggle=“tab”或data-bs-toggle=“pill”即可啟動標簽或膠囊狀導航,而無需編寫任何JavaScript。可在.nav-tabs或.nav-pills上使用這些數據屬性

<!-- Nav tabs -->
<ul class="nav nav-tabs" id="myTab" role="tablist">
<li class="nav-item" role="presentation">
<button class="nav-link active" id="home-tab" data-bs-toggle="tab" data-bs-target="#home" type="button" role="tab" aria-controls="home" aria-selected="true">Home</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link" id="profile-tab" data-bs-toggle="tab" data-bs-target="#profile" type="button" role="tab" aria-controls="profile" aria-selected="false">Profile</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link" id="messages-tab" data-bs-toggle="tab" data-bs-target="#messages" type="button" role="tab" aria-controls="messages" aria-selected="false">Messages</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link" id="settings-tab" data-bs-toggle="tab" data-bs-target="#settings" type="button" role="tab" aria-controls="settings" aria-selected="false">Settings</button>
</li>
</ul>

<!-- Tab panes -->
<div class="tab-content">
<div class="tab-pane active" id="home" role="tabpanel" aria-labelledby="home-tab">...</div>
<div class="tab-pane" id="profile" role="tabpanel" aria-labelledby="profile-tab">...</div>
<div class="tab-pane" id="messages" role="tabpanel" aria-labelledby="messages-tab">...</div>
<div class="tab-pane" id="settings" role="tabpanel" aria-labelledby="settings-tab">...</div>
</div>

通過JavaScript

透過JavaScript啟用分頁標簽(每一個分頁標簽需要分別啟動):

var triggerTabList = [].slice.call(document.querySelectorAll('#myTab a'))
triggerTabList.forEach(function (triggerEl) {
var tabTrigger = new bootstrap.Tab(triggerEl)

triggerEl.addEventListener('click', function (event) {
event.preventDefault()
tabTrigger.show()
})
})

啟用分頁標簽有以下數種方法:

var triggerEl = document.querySelector('#myTab a[href="#profile"]')
bootstrap.Tab.getInstance(triggerEl).show() // Select tab by name

var triggerFirstTabEl = document.querySelector('#myTab li:first-child a')
bootstrap.Tab.getInstance(triggerFirstTabEl).show() // Select first tab

淡入效果

要使分頁標簽淡入淡出,請將.fade加到每個.tab-pane中。第一個分頁內容還必須具有.show以使初始內容可見。

<div class="tab-content">
<div class="tab-pane fade show active" id="home" role="tabpanel" aria-labelledby="home-tab">...</div>
<div class="tab-pane fade" id="profile" role="tabpanel" aria-labelledby="profile-tab">...</div>
<div class="tab-pane fade" id="messages" role="tabpanel" aria-labelledby="messages-tab">...</div>
<div class="tab-pane fade" id="settings" role="tabpanel" aria-labelledby="settings-tab">...</div>
</div>

方法

Asynchronous methods and transitions

All API methods are asynchronous and start a transition. They return to the caller as soon as the transition is started but before it ends. In addition, a method call on a transitioning component will be ignored.

See our JavaScript documentation for more information.

構造

啟動分頁標簽元素和內容容器。標簽應該有一個data-bs-target或href定位在DOM中的一個容器節點。

<ul class="nav nav-tabs" id="myTab" role="tablist">
<li class="nav-item" role="presentation">
<button class="nav-link active" id="home-tab" data-bs-toggle="tab" data-bs-target="#home" type="button" role="tab" aria-controls="home" aria-selected="true">Home</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link" id="profile-tab" data-bs-toggle="tab" data-bs-target="#profile" type="button" role="tab" aria-controls="profile" aria-selected="false">Profile</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link" id="messages-tab" data-bs-toggle="tab" data-bs-target="#messages" type="button" role="tab" aria-controls="messages" aria-selected="false">Messages</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link" id="settings-tab" data-bs-toggle="tab" data-bs-target="#settings" type="button" role="tab" aria-controls="settings" aria-selected="false">Settings</button>
</li>
</ul>

<div class="tab-content">
<div class="tab-pane active" id="home" role="tabpanel" aria-labelledby="home-tab">...</div>
<div class="tab-pane" id="profile" role="tabpanel" aria-labelledby="profile-tab">...</div>
<div class="tab-pane" id="messages" role="tabpanel" aria-labelledby="messages-tab">...</div>
<div class="tab-pane" id="settings" role="tabpanel" aria-labelledby="settings-tab">...</div>
</div>

<script>
var firstTabEl = document.querySelector('#myTab li:last-child a')
var firstTab = new bootstrap.Tab(firstTabEl)

firstTab.show()
</script>

顯示

選擇給定的分頁標簽并顯示其關聯的分頁內容。之前選擇的任何其他分頁標簽將被取消,并且其關聯的內容被隱藏。在Tab內容實際顯示之前返回到調用者(即在shown.bs.tab事件發生之前)。

  var someTabTriggerEl = document.querySelector('#someTabTrigger')
var tab = new bootstrap.Tab(someTabTriggerEl)

tab.show()

銷毀

銷毀一個元素的分頁標簽。

獲取實例

Static方法,該方法使您可以獲取與DOM元素關聯的選項實例

var triggerEl = document.querySelector('#trigger')
var tab = bootstrap.Tab.getInstance(triggerEl) // Returns a Bootstrap tab instance

事件

顯示新標簽時,事件將按以下順序觸發:

  1. hide.bs.tab(當前活動的分頁標簽上)
  2. show.bs.tab (待顯示的分頁標簽上)
  3. hidden.bs.tab (在上一個啟動的分頁標簽上,與hide.bs.tab事件相同)
  4. shown.bs.tab(在剛剛顯示的新分頁標簽上,與show.bs.tab事件相同)

如果沒有分頁標簽已經被啟動,那么hide.bs.tab和hidden.bs.tab事件不會被觸發。

Event type Description
show.bs.tab 這個事件因頁簽顯示而觸發,但是會在新頁簽被顯示之前結束。使用event.target和event.relatedTarget將目前與先前啟用的頁簽(如果可用)的作為目標。
shown.bs.tab 這個事件在頁簽顯示后觸發。使用event.target和event.relatedTarget來分別定位啟用中和剛剛啟用的頁簽。
hide.bs.tab 新的頁簽要顯示(先前的啟用頁簽將被隱藏)時,此事將觸發。使用event.target和event.relatedTarget分別定位先前啟用和即將啟用的頁簽。
hidden.bs.tab 新的選項顯示后(因此先前啟用的選項將隱藏),此事件將觸發。使用event.target和event.relatedTarget分別定位先前啟用的頁簽和新啟用的頁簽。
var tabEl = document.querySelector('button[data-bs-toggle="tab"]')
tabEl.addEventListener('shown.bs.tab', function (event) {
event.target // newly activated tab
  event.relatedTarget // previous active tab
})
返回頂部
精品久久久久久亚洲精品_成人午夜网站_www日本高清_亚洲精品久久久久午夜福

      欧美 日韩 国产在线| 欧美成人午夜激情| 亚洲人成网站在线观看播放| 午夜精品在线观看| 一色屋精品视频在线观看网站| 亚洲一区二区三区激情| 欧美精品一区三区| 久久久久成人精品| 亚洲综合色丁香婷婷六月图片| 欧美日韩国产亚洲一区| 日韩亚洲欧美精品| 亚洲国产91色在线| 好吊色欧美一区二区三区视频| 久久激情五月丁香伊人| 国产真实久久| 国产精品视频| 国产精品ⅴa在线观看h| 宅男66日本亚洲欧美视频| 国产精品久久久久久久午夜| 这里只有视频精品| 日韩午夜电影| 亚洲高清视频一区二区| 欧美日本不卡| 欧美激情精品久久久久久免费印度 | 亚洲午夜精品久久久久久浪潮| 亚洲线精品一区二区三区八戒| 欧美性一区二区| 欧美日韩在线影院| 欧美手机在线视频| 国产精品福利久久久| 久久精品99国产精品日本| 在线观看视频免费一区二区三区| 欧美大片91| 欧美成人一区二区三区在线观看| 一区二区精品在线| 99视频精品免费观看| 国产欧美日韩精品丝袜高跟鞋| 久久国产视频网站| 久久九九久久九九| 另类春色校园亚洲| 欧美日本网站| 国产精品一区三区| 国内精品久久久久久久影视麻豆| 欧美日韩高清不卡| 国产精品极品美女粉嫩高清在线| 久久久久久久久久久一区 | 在线欧美不卡| 亚洲福利视频三区| 99爱精品视频| 欧美一级视频精品观看| 一本色道久久加勒比精品| 国内成人精品视频| 91久久精品久久国产性色也91 | 国产婷婷97碰碰久久人人蜜臀| 欧美成人免费全部| 国产精品黄页免费高清在线观看| 欧美激情一区二区三区不卡| 欧美中文日韩| 欧美激情精品久久久久久黑人| 久久久精品免费视频| 亚洲一区久久久| 91久久线看在观草草青青| 激情校园亚洲| 亚洲与欧洲av电影| 久久精品官网| 国内自拍一区| 最新日韩在线| 先锋影音国产一区| 欧美粗暴jizz性欧美20| 亚洲欧美日韩精品久久| 一区二区三区福利| 久久嫩草精品久久久久| 欧美一区二区三区啪啪| 亚洲综合精品四区| 欧美肥婆bbw| 国产伪娘ts一区| 亚洲视频综合| 欧美国产乱视频| 在线日韩电影| 久久gogo国模裸体人体| 久久久久国产一区二区三区| 国产精品午夜电影| 久久精品五月| 国产精品一香蕉国产线看观看| 国产精品成人观看视频国产奇米| 欧美日韩亚洲一区| 亚洲激情亚洲| 欧美成ee人免费视频| 欧美激情第8页| 亚洲第一网站| 久久久无码精品亚洲日韩按摩| 欧美在线三区| 国产精品乱人伦一区二区 | 亚洲专区一区二区三区| 亚洲欧美日韩天堂一区二区| 欧美中文字幕| 国产欧美日韩亚洲一区二区三区 | 1000部国产精品成人观看| 亚洲高清成人| 美女露胸一区二区三区| 欧美激情精品| 亚洲精品欧美| 欧美日韩人人澡狠狠躁视频| 国产精品视频一二三| 狠狠色综合日日| 久久人人九九| 亚洲国产精品一区在线观看不卡| 亚洲素人在线| 国产精品一二三视频| 亚洲欧洲中文日韩久久av乱码| 亚洲午夜免费福利视频| 久久久久久9| 亚洲第一在线综合网站| 欧美一区二区视频免费观看| 欧美激情bt| 中文av一区特黄| 国产精品天天摸av网| 国产欧美婷婷中文| 性欧美1819性猛交| 狠狠入ady亚洲精品经典电影| 夜夜嗨一区二区| 国产精品亚洲а∨天堂免在线| 最新国产乱人伦偷精品免费网站 | 国产一区二区三区av电影| 9色porny自拍视频一区二区| 久久久水蜜桃| 日韩视频在线观看免费| 久久亚洲精品一区| 99这里只有久久精品视频| 久久久久欧美| 国产伊人精品| 欧美日韩精品福利| 欧美影院一区| 99精品99久久久久久宅男| 欧美久久九九| 久久本道综合色狠狠五月| 国产美女一区二区| 欧美成人第一页| 欧美一区二区视频在线观看2020| 欧美日本乱大交xxxxx| 亚洲国产婷婷综合在线精品| 麻豆av一区二区三区久久| 国精品一区二区三区| 久久精品国产一区二区三区免费看| 欧美性事在线| 欧美激情a∨在线视频播放| 一本一本久久a久久精品综合麻豆 一本一本久久a久久精品牛牛影视 | 亚洲一区二区在线免费观看视频| 欧美日韩精品一本二本三本| 亚洲黄页视频免费观看| 欧美日本韩国一区| 久久久噜噜噜久噜久久| 一区二区视频在线观看| 噜噜噜久久亚洲精品国产品小说| 一区精品在线播放| 国产日韩精品一区二区| 欧美在线观看视频在线| 国产色综合网| 国产精品户外野外| 国产精品国产三级国产普通话99| 亚洲影院在线| 亚洲一区二区三区乱码aⅴ| 国产美女精品视频免费观看| 性色av一区二区三区| 伊人精品在线| 国产精品制服诱惑| 国产精品久久久久av| 久久精品国产精品亚洲| 91久久久久久国产精品| 蜜臀av在线播放一区二区三区| 一区在线播放| 精品51国产黑色丝袜高跟鞋| 久久久人成影片一区二区三区 | 久久中文欧美| 欧美一级一区| 久久久久久久久岛国免费| 亚洲毛片在线免费观看| 久久人人97超碰精品888| 国产亚洲福利社区一区| 蜜臀av性久久久久蜜臀aⅴ| 亚洲午夜在线观看| 伊人色综合久久天天| 欧美性理论片在线观看片免费| 欧美一区网站| 99精品视频免费观看| 狠狠综合久久| 亚洲国产欧美国产综合一区| 国产精品入口日韩视频大尺度| 久久久久久欧美| 欧美成人激情视频免费观看| 性色av一区二区三区红粉影视| 亚洲精品一区二区三区不| 国产日本亚洲高清| 亚洲东热激情| 性欧美video另类hd性玩具| 日韩一级免费| 久久久国产精品亚洲一区 | 欧美日韩国产首页在线观看| 久久精品一二三区| 欧美精品一区二区精品网 |