Fix: tab content hide show bug
This commit is contained in:
+18
-16
@@ -160,6 +160,7 @@ function updatePlayerListPage(playerList) {
|
|||||||
|
|
||||||
|
|
||||||
function tabClicked(tabNo) {
|
function tabClicked(tabNo) {
|
||||||
|
// hide and show tab
|
||||||
for(let i = 0; i < 4; i++) {
|
for(let i = 0; i < 4; i++) {
|
||||||
$("#page-tabs li").filter(":eq(" + i + ")").removeClass("activated");
|
$("#page-tabs li").filter(":eq(" + i + ")").removeClass("activated");
|
||||||
}
|
}
|
||||||
@@ -167,30 +168,31 @@ function tabClicked(tabNo) {
|
|||||||
let tabIndex = tabNo - 1;
|
let tabIndex = tabNo - 1;
|
||||||
$("#page-tabs li").filter(":eq(" + tabIndex + ")").addClass("activated");
|
$("#page-tabs li").filter(":eq(" + tabIndex + ")").addClass("activated");
|
||||||
|
|
||||||
|
// hide and show content
|
||||||
switch(tabNo) {
|
switch(tabNo) {
|
||||||
case 1:
|
case 1:
|
||||||
$(".player_list").removeClass("hide");
|
$("#section_add_player").removeClass("hide");
|
||||||
$(".search").addClass("hide");
|
$("#search").addClass("hide");
|
||||||
$(".mouse_app_list").addClass("hide");
|
$("#mouse_app_list").addClass("hide");
|
||||||
$(".typing_app_list").addClass("hide");
|
$("#typing_app_list").addClass("hide");
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
$(".player_list").addClass("hide");
|
$("#section_add_player").addClass("hide");
|
||||||
$(".search").removeClass("hide");
|
$("#search").removeClass("hide");
|
||||||
$(".mouse_app_list").addClass("hide");
|
$("#mouse_app_list").addClass("hide");
|
||||||
$(".typing_app_list").addClass("hide");
|
$("#typing_app_list").addClass("hide");
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
$(".player_list").addClass("hide");
|
$("#section_add_player").addClass("hide");
|
||||||
$(".search").addClass("hide");
|
$("#search").addClass("hide");
|
||||||
$(".mouse_app_list").removeClass("hide");
|
$("#mouse_app_list").removeClass("hide");
|
||||||
$(".typing_app_list").addClass("hide");
|
$("#typing_app_list").addClass("hide");
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
$(".player_list").addClass("hide");
|
$("#section_add_player").addClass("hide");
|
||||||
$(".search").addClass("hide");
|
$("#search").addClass("hide");
|
||||||
$(".mouse_app_list").addClass("hide");
|
$("#mouse_app_list").addClass("hide");
|
||||||
$(".typing_app_list").removeClass("hide");
|
$("#typing_app_list").removeClass("hide");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ $(document).ready(function() {
|
|||||||
<div id="section_add_player">
|
<div id="section_add_player">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="search hide">
|
<div id="search" class="hide">
|
||||||
<div>
|
<div>
|
||||||
검색
|
검색
|
||||||
아이디
|
아이디
|
||||||
@@ -41,7 +41,7 @@ $(document).ready(function() {
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mouse_app_list hide">
|
<div id="mouse_app_list" class="hide">
|
||||||
<form action="/action_page.php" method="get" id="app_mouse">
|
<form action="/action_page.php" method="get" id="app_mouse">
|
||||||
<input type="checkbox" name="mouse">클릭 연습<br/>
|
<input type="checkbox" name="mouse">클릭 연습<br/>
|
||||||
<input type="checkbox" name="mouse">더블 클릭 연습<br/>
|
<input type="checkbox" name="mouse">더블 클릭 연습<br/>
|
||||||
@@ -49,7 +49,7 @@ $(document).ready(function() {
|
|||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="typing_app_list hide">
|
<div id="typing_app_list" class="hide">
|
||||||
<form action="/action_page.php" method="get" id="app_typing">
|
<form action="/action_page.php" method="get" id="app_typing">
|
||||||
<input type="checkbox" name="typing">기본 자리<br/>
|
<input type="checkbox" name="typing">기본 자리<br/>
|
||||||
<input type="checkbox" name="typing">왼손 윗글쇠<br/>
|
<input type="checkbox" name="typing">왼손 윗글쇠<br/>
|
||||||
|
|||||||
Reference in New Issue
Block a user