SuperScriptMaterializer/SuperScriptViewer/static/tabcontrol.js
2020-08-10 11:45:43 +08:00

13 lines
535 B
JavaScript

function tabControlSwitcher(tabcontrolIndex, neededIndex) {
//disable all
$(".tabnavigation_" + tabcontrolIndex).each(function () {
$(this).removeClass("tabitem-activated").addClass("tabitem-deactivated");
});
$(".tabpanel_" + tabcontrolIndex).each(function () {
$(this).hide();
});
// set current
$("#tabnavigation_" + tabcontrolIndex + "_" + neededIndex).removeClass("tabitem-deactivated").addClass("tabitem-activated");
$("#tabpanel_" + tabcontrolIndex + "_" + neededIndex).show();
}