MediaWiki:HoverTabs/code.js

/** Related to Don't Starve Wiki Hover Tabs Enabling this scripts allows tabs identified by DSWHoverChangesZIndex css class to be pinned by clicking the tab selector in them, identified by DSWHoverChangesOpacity css class. Clicking an item with DSWHoverChangesOpacity class changes the css class assignments for its first parent with DSWHoverChangesZIndex class, replacing it with DSWHoverChangesZIndexDefault class, as well as all its siblings with DSWHoverChangesZIndexDefault class, replacing it with DSWHoverChangesZIndex class. The final effect is that the clicked tab becomes default, which shows on top of everything else if mouse cursor is not on any of the other tabs, and the existing default loses its default status.

$(".DSWHoverChangesOpacity").click(function{       var tab = $(this).closest(".DSWHoverChangesZIndex");        if (tab.length > 0)        {            tab.siblings(".DSWHoverChangesZIndexDefault").removeClass("DSWHoverChangesZIndexDefault").addClass("DSWHoverChangesZIndex");            tab.removeClass("DSWHoverChangesZIndex").addClass("DSWHoverChangesZIndexDefault");        } }); })(this.jQuery);
 * (function ($) {