Runtime module for Wikidot's [[tabview]] / [[tab]] tab switching.
The server renders tabs using Yahoo UI (YUI) CSS class conventions:
.yui-navset wraps the entire tab component
.yui-nav > li items form the tab bar (the selected class marks the active tab)
.yui-content > div children hold each tab's content panel
This module uses event delegation on the root element to listen for
clicks on any .yui-nav li and toggles the selected class and
content panel visibility by matching the clicked tab's index to the
corresponding content <div>.
DOM interactions:
Listens for click (bubble) on root, delegated to .yui-navset .yui-nav li
Toggles .selected class on nav items
Shows/hides content divs via style.display
The destroy() cleanup function removes the click listener.
Runtime module for Wikidot's
[[tabview]]/[[tab]]tab switching.The server renders tabs using Yahoo UI (YUI) CSS class conventions:
.yui-navsetwraps the entire tab component.yui-nav > liitems form the tab bar (theselectedclass marks the active tab).yui-content > divchildren hold each tab's content panelThis module uses event delegation on the root element to listen for clicks on any
.yui-nav liand toggles theselectedclass and content panel visibility by matching the clicked tab's index to the corresponding content<div>.DOM interactions:
click(bubble) on root, delegated to.yui-navset .yui-nav li.selectedclass on nav itemsstyle.displayThe
destroy()cleanup function removes the click listener.