Vanilla JavaScript Tabs - simple and awesome.
— Inspired by the blazing fast, lightweight, cross-platform and crazy popular Vanilla JS framework.
Option | Type | Default | Description |
---|---|---|---|
elem | string | HTML id of the tab container in the HTML markup. | |
open | number | 0 | Opens this tab initially. |
Method | Type | Description |
---|---|---|
open(n) | number | Opens a tab by index |
update(n) | number | Updates the tabs with n-th tab open (useful when dynamically adding tabs) |
destroy() | Removes the listeners |
var tabs = Tabs({
elem: "tabs",
open: 1,
});
// Open any other tab
tabs.open(3);
npm test
Browser | Support | Dependencies |
---|---|---|
Chrome | yes | - |
Firefox | yes | - |
Safari | yes | - |
Opera | yes | - |
IE9 and up | yes | - |
Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.
See Unlicense for full details.