SuperScriptMaterializer/SuperScriptViewer/static/tabcontrol.js

13 lines
535 B
JavaScript
Raw Normal View History

2020-08-10 11:45:43 +08:00
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();
}