Fix: tab content hide show bug

This commit is contained in:
2018-07-03 06:49:09 +09:00
parent 474e7757db
commit 06bf617885
2 changed files with 21 additions and 19 deletions
+18 -16
View File
@@ -160,6 +160,7 @@ function updatePlayerListPage(playerList) {
function tabClicked(tabNo) {
// hide and show tab
for(let i = 0; i < 4; i++) {
$("#page-tabs li").filter(":eq(" + i + ")").removeClass("activated");
}
@@ -167,30 +168,31 @@ function tabClicked(tabNo) {
let tabIndex = tabNo - 1;
$("#page-tabs li").filter(":eq(" + tabIndex + ")").addClass("activated");
// hide and show content
switch(tabNo) {
case 1:
$(".player_list").removeClass("hide");
$(".search").addClass("hide");
$(".mouse_app_list").addClass("hide");
$(".typing_app_list").addClass("hide");
$("#section_add_player").removeClass("hide");
$("#search").addClass("hide");
$("#mouse_app_list").addClass("hide");
$("#typing_app_list").addClass("hide");
break;
case 2:
$(".player_list").addClass("hide");
$(".search").removeClass("hide");
$(".mouse_app_list").addClass("hide");
$(".typing_app_list").addClass("hide");
$("#section_add_player").addClass("hide");
$("#search").removeClass("hide");
$("#mouse_app_list").addClass("hide");
$("#typing_app_list").addClass("hide");
break;
case 3:
$(".player_list").addClass("hide");
$(".search").addClass("hide");
$(".mouse_app_list").removeClass("hide");
$(".typing_app_list").addClass("hide");
$("#section_add_player").addClass("hide");
$("#search").addClass("hide");
$("#mouse_app_list").removeClass("hide");
$("#typing_app_list").addClass("hide");
break;
case 4:
$(".player_list").addClass("hide");
$(".search").addClass("hide");
$(".mouse_app_list").addClass("hide");
$(".typing_app_list").removeClass("hide");
$("#section_add_player").addClass("hide");
$("#search").addClass("hide");
$("#mouse_app_list").addClass("hide");
$("#typing_app_list").removeClass("hide");
break;
}
}
+3 -3
View File
@@ -24,7 +24,7 @@ $(document).ready(function() {
<div id="section_add_player">
</div>
<div class="search hide">
<div id="search" class="hide">
<div>
검색
아이디
@@ -41,7 +41,7 @@ $(document).ready(function() {
</div>
<div class="mouse_app_list hide">
<div id="mouse_app_list" class="hide">
<form action="/action_page.php" method="get" id="app_mouse">
<input type="checkbox" name="mouse">클릭 연습<br/>
<input type="checkbox" name="mouse">더블 클릭 연습<br/>
@@ -49,7 +49,7 @@ $(document).ready(function() {
</form>
</div>
<div class="typing_app_list hide">
<div id="typing_app_list" class="hide">
<form action="/action_page.php" method="get" id="app_typing">
<input type="checkbox" name="typing">기본 자리<br/>
<input type="checkbox" name="typing">왼손 윗글쇠<br/>