--- { "title": "Interface à onglets", "language": "fr", "category": "Plugiciels", "categoryfile": "plugins", "description": "Comprime plusieurs images et légendes superposées et fourni des controls qui permettent à l'utilisateur de choisi l'image à afficher.", "altLangPrefix": "tabs", "dateModified": "2018-04-18" } ---
Needs translation
Dynamically stacks multiple sections of content, transforming them into a tabbed interface. Implements the WAI-ARIA tab panel design pattern for large screens and the WAI-ARIA accordion design pattern for small screens.
div element to the page with the class wb-tabs.div element to the previous div element with the class tabpanels.details element with a unique id. Add open="open" for the tab panel that should be open by default.
<div class="wb-tabs">
<div class="tabpanels">
<details id="details-panel1">
...
</details>
<details id="details-panel2" open="open">
...
</details>
summary element with the label of the tab to each details element.
<details id="details-panel1">
<summary>Example 1</summary>
...
</details>
<details id="details-panel2" open="open">
<summary>Example 2</summary>
...
</details>
summary element.<div class="wb-tabs">
<div class="tabpanels">
<details id="details-panel1">
<summary>Example 1</summary>
<p>
...
</p>
</details>
<details id="details-panel2" open="open">
<summary>Example 2</summary>
<p>
...
</p>
</details>
...
</div>
</div>
div element to the page with the class wb-tabs and either the styling class carousel-s1 or carousel-s2.div element to the previous div element with the class tabpanels.div element with a unique id, role="tabpanel" and class="out". For the tab panel that should be opened by default, replace the out class with in.div element for each of the tab panels:
fade: Fading transitionslide: Horizontal sliding transitionslidevert: Vertical sliding transition<div class="wb-tabs carousel-s1">
<div class="tabpanels">
<div role="tabpanel" id="panel1" class="in fade">
</div>
<div role="tabpanel" id="panel2" class="out fade">
</div>
</div>
</div>
figure element to each tab panel.figure element:
figure element followed by a figcaption element with the caption for the tab panel.
<div role="tabpanel" id="panel1" class="in fade">
<figure>
<img src="img/protect-environment.jpg" alt="Panel 1" />
<figcaption>
<p>
Take Note: <a href="https://www.tc.gc.ca/eng/civilaviation/opssvs/general-personnel-changes-1814.htm">Renewal of the Aviation Document Booklet</a> <br />
Learn more about <a href="https://www.tc.gc.ca/eng/air-menu.htm">air transportation</a> in Canada.
</p>
</figcaption>
</figure>
</div>
figure element according to the multimedia player documentation.
<div role="tabpanel" id="panel1" class="in fade">
<figure class="wb-mltmd">
<video poster="../multimedia/demo/video1-en.jpg" title="Looking for a Job">
<source type="video/webm" src="https://video2.servicecanada.gc.ca/video/boew-wet/te-lj-eng.webm" />
<source type="video/mp4" src="https://video2.servicecanada.gc.ca/video/boew-wet/te-lj-eng.mp4" />
<track src="../multimedia/cpts-lg-en.html" kind="captions" data-type="text/html" srclang="en" label="English" />
</video>
<figcaption>
<p>Looking for a Job (<a href="../multimedia/cpts-lg-en.html">Transcript</a>)</p>
</figcaption>
</figure>
</div>
figure element followed by a figcaption element with the caption for the tab panel.
<div role="tabpanel" id="panel1" class="in fade">
<figure>
<table>
...
</table>
<figcaption>
<p>Tab panel caption</p>
</figcaption>
</figure>
</div>
ul element with role="tablist" at the start of the div element with the wb-tabs class.li element to the previous ul element. Add class="active" for the tab panel that should be open by default.a element to each li element
li element an a element with the label of the tab and that links to the associated tab panel.
<ul role="tablist">
<li class="active"><a href="#panel27">Tab 1</a></li>
<li><a href="#panel28">Tab 2</a></li>
...
</ul>
<p><a href="#panel3" class="wb-tabs-ext">Show the third panel</a></p>
<div class="wb-tabs carousel-s1">
<ul role="tablist">
<li class="active"><a href="#panel1">Tab 1</a></li>
<li><a href="#panel2">Tab 2</a></li>
...
</ul>
<div class="tabpanels">
<div role="tabpanel" id="panel1" class="in fade">
<figure>
<img src="img/protect-environment.jpg" alt="Panel 1" />
<figcaption>
<p>
...
</p>
</figcaption>
</figure>
</div>
<div role="tabpanel" id="panel2" class="out fade">
<figure>
<img src="img/banff.jpg" alt="Panel 2" />
<figcaption>
<p>
...
</p>
</figcaption>
</figure>
</div>
...
</div>
</div>
| Option | Description | How to configure | Values |
|---|---|---|---|
Update the URL hash (data-wb-tabs) (v4.0.9+) |
Configure the tab interface or carousel to update the URL hash every time the tab panel changes through the updateHash property of the data-wb-tabs attribute. |
Add the data-wb-tabs attribute to the element with class="wb-tabs" and include the updateHash property with a true or false value.
|
|
Update the URL hash (update-hash) (v4.0.9+) |
Configure the tab interface or carousel to update the URL hash every time the tab panel changes through the update-hash class. |
Add update-hash after the wb-tabs class.
|
|
Ignore session storage (data-wb-tabs) (v4.0.12+) |
Configure the tab interface to remain on the first or default selected tab on all page loads through the ignoreSession property of the data-wb-tabs attribute. |
Add the data-wb-tabs attribute to the element with class="wb-tabs" and include the ignoreSession property with a true or false value.
|
|
Ignore session storage (ignore-session) (v4.0.12+) |
Configure the tab interface to remain on the first or default selected tab on all page loads through the ignore-session class. |
Add ignore-session after the wb-tabs class.
|
|
Print only the active (visible) panel (print-active) (v4.0.15+) |
Configure the tab interface to print only the active (visible) panel through the print-active class. |
Add print-active after the wb-tabs class.
|
|
| Option | Description | How to configure | Values |
|---|---|---|---|
| Carousel style | Configures the carousel style. | Add the value after the wb-tabs class (e.g., class="wb-tabs carousel-s1") |
|
Change rotation speed (data-wb-tabs) |
Configure the tab rotation speed through the interval property of the data-wb-tabs attribute. |
Add the data-wb-tabs attribute to the element with class="wb-tabs" and include the interval property with the number of seconds between tab rotations.
|
|
Change rotation speed (slow, fast) |
Configure the tab rotation speed through either the slow or fast classes. |
Add either slow or fast after the wb-tabs class.
|
|
| Tab panel transitions | Configure the tab panel transition type through the fade, slide or slidevert classes. |
Add fade, slide or slidevert after the in or out class on each tab panel.
|
|
Exclude play (data-wb-tabs) (v4.0.5+) |
Exclude the play button from the carousel controls through the excludePlay property of the data-wb-tabs attribute. |
Add the data-wb-tabs attribute to the element with class="wb-tabs" and include the excludePlay property with true for the value.
|
|
Exclude play (exclude-play) (v4.0.5+) |
Exclude the play button from the carousel controls through the exclude-play class. |
Add exclude-play after the wb-tabs class.
|
|
Play on page load (data-wb-tabs) (v4.0.5+) |
Play the carousel on page load through the playing property of the data-wb-tabs attribute.Warning: Playing on page load can be distracting and cause usability issues for some users. Note: Playing will be disabled if the play button is excluded from the carousel controls. |
Add the data-wb-tabs attribute to the element with class="wb-tabs" and include the playing property with true for the value.
|
|
Play on page load (playing) |
Play the carousel on page load through the playing class.Warning: Playing on page load can be distracting and cause usability issues for some users. Note: Playing will be disabled if the play button is excluded from the carousel controls. |
Add playing after the wb-tabs class.
|
|
| Event | Trigger | What it does |
|---|---|---|
| wb-init.wb-tabs | Triggered manually (e.g., $( ".wb-tabs" ).trigger( "wb-init.wb-tabs" );). |
Used to manually initialize the Tabbed interface plugin. Note: The Tabbed interface plugin will be initialized automatically unless the required markup is added after the page has already loaded. |
wb-ready.wb-tabs (v4.0.5+) |
Triggered automatically after a tabbed interface or carousel initializes. | Used to identify which tabbed interface or carousel was initialized (target of the event)
|
wb-updated.wb-tabs (v4.0.5+) |
Triggered automatically after a tabbed interface/carousel was updated (visible tab panel changed). | Used to identify which tabbed inteface/carousel was updated (target of the event) and to pass along the newly visible panel (as a jQuery object).
|
wb-shift.wb-tabs |
Triggered manually or automatically to change which tab panel is visible. | Changes which tab panel is visible. The value of shiftto is the number of tab panels to move forwards (positive number) or backwards (negative number).
|
wb-select.wb-tabs (v4.0.8+) |
Triggered manually or automatically to change which tab panel is visible. | Changes which tab panel is visible. The value of id is the id attribute of the tab panel to make visible.
|
wb-ready.wb (v4.0.5+) |
Triggered automatically when WET has finished loading and executing. | Used to identify when all WET plugins and polyfills have finished loading and executing.
|