# domtabs documentation ## Initialisations * First create the Domtabs object `$mytabs = new Domtabs($divid, $background_colour, $inac_tabs_bg_colour, $inac_tabs_fg_colour, $focus_tabs_fg_colour)`
where colours are : * `$background_colour`: background of active tab and tab panel * `$inac_tabs_bg_colour`: background of inactive tabs and foreground of active tab * `$inac_tabs_fg_colour`: foreground of inactive tabs * `$focus_tabs_fg_colour`: foreground + top border highlight of focused inactive tab * Add to this object the tabs headings `$mytabs->add_tab_header($tabname);` * Include the following line in `
` `display_header_content() ?>` * `` should call javascript initialisation : `` ## Affichage des onglets * Display tabs header: `display_tab_header($init) ?>` `$init` is the number of tab that should be initially displayed (from 0 to n-1), by default it's the first (#0). If value does not exist, first tab is displayed. * Then insert the content of first tab panel. * For each new tab, insert the following: `display_next_tab() ?>` and insert the content of next tab panel. * Close the tab with : `display_footer() ?>` ## Minimal example ``` add_tab_header("First tab"); $mytabs->add_tab_header("Second tab"); $mytabs->add_tab_header("Third tab"); ?> Tabs sample display_header_content() ?>

Tab sample

display_tab_header() ?> Content of first tab panel display_next_tab() ?> Content of second tab panel display_next_tab() ?> Content of thirds tab panel display_footer() ?> ``` ## References * [Wendy Ho's pure CSS Tab](https://codepen.io/Wendy-Ho/pen/MWWBvmd) * [WAI aria example](https://www.w3.org/TR/wai-aria-practices/examples/tabs/tabs-1/tabs.html) * [W3 Schools tabs](https://www.w3schools.com/howto/howto_js_tabs.asp) --- Dominique Archambault Université Paris 8-Vincennes-Saint-Denis, Master Handi, 2020 This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.