လုပ်နည်း - ဇယားကွက်ချဲ့ခြင်း။
CSS နှင့် JavaScript ဖြင့် ချဲ့ထွင်ထားသော ဇယားကွက်တစ်ခု ဖန်တီးနည်းကို လေ့လာပါ။
ဇယားကွက်ချဲ့ခြင်း။
၎င်းကို "ချဲ့ရန်" အကွက်ပေါ်တွင် ကလစ်နှိပ်ပါ (100% အကျယ်)
×
သေတ္တာ ၁
နာကျင်မှုကို ကိုယ်တိုင်စစ်ဆေးကြည့်ရအောင်၊ သင်ယူလေ့လာထားသူတွေကို လျော့ပါးသွားစေပြီး သက်သာရာရကြောင်း နားလည်လိုက်ပါ။ မှန်ကန်သော အမှားသည် စွန့်ပယ်ထားသော ကြော်ငြာကို ဆိုလိုသည်။
×
သေတ္တာ ၂
နာကျင်မှုကို ကိုယ်တိုင်စစ်ဆေးကြည့်ရအောင်၊ သင်ယူလေ့လာထားသူတွေကို လျော့ပါးသွားစေပြီး သက်သာရာရကြောင်း နားလည်လိုက်ပါ။ မှန်ကန်သော အမှားသည် စွန့်ပယ်ထားသော ကြော်ငြာကို ဆိုလိုသည်။
×
သေတ္တာ ၃
နာကျင်မှုကို ကိုယ်တိုင်စစ်ဆေးကြည့်ရအောင်၊ သင်ယူလေ့လာထားသူတွေကို လျော့ပါးသွားစေပြီး သက်သာရာရကြောင်း နားလည်လိုက်ပါ။ မှန်ကန်သော အမှားသည် စွန့်ပယ်ထားသော ကြော်ငြာကို ဆိုလိုသည်။
ချဲ့ထွင်ထားသော Grid တစ်ခုကို ဖန်တီးပါ။
အဆင့် 1) HTML ကိုထည့်ပါ
ဥပမာ
<!-- The grid: three columns -->
<div class="row">
<div class="column" onclick="openTab('b1');" style="background:green;">Box
1</div>
<div class="column" onclick="openTab('b2');" style="background:blue;">Box
2</div>
<div class="column" onclick="openTab('b3');" style="background:red;">Box
3</div>
</div>
<!-- The expanding grid (hidden by default) -->
<div id="b1" class="containerTab" style="display:none;background:green">
<!-- If you want the ability to close the container, add a close button -->
<span onclick="this.parentElement.style.display='none'" class="closebtn">x</span>
<h2>Box 1</h2>
<p>Lorem ipsum..</p>
</div>
<div id="b2" class="containerTab" style="display:none;background:blue">
<span onclick="this.parentElement.style.display='none'" class="closebtn">x</span>
<h2>Box 2</h2>
<p>Lorem ipsum..</p>
</div>
<div id="b3" class="containerTab" style="display:none;background:red">
<span onclick="this.parentElement.style.display='none'" class="closebtn">x</span>
<h2>Box 3</h2>
<p>Lorem ipsum..</p>
</div>
အဆင့် 2) CSS ကိုထည့်ပါ
ကော်လံသုံးခု ဖန်တီးပါ-
ဥပမာ
/* The grid: Three equal columns that floats next to each other */
.column
{
float: left;
width: 33.33%;
padding: 50px;
text-align: center;
font-size: 25px;
cursor: pointer;
color: white;
}
.containerTab
{
padding: 20px;
color: white;
}
/* Clear floats after the
columns */
.row:after {
content: "";
display: table;
clear: both;
}
/* Closable button inside the image */
.closebtn {
float: right;
color: white;
font-size: 35px;
cursor: pointer;
}
အဆင့် 3) JavaScript ကိုထည့်ပါ။
ဥပမာ
// Hide all elements with class="containerTab",
except for the one that matches the clickable grid column
function openTab(tabName) {
var i, x;
x = document.getElementsByClassName("containerTab");
for (i = 0; i < x.length; i++) {
x[i].style.display = "none";
}
document.getElementById(tabName).style.display = "block";
}