ကျွတ်ဖြည့်တာ ပုံစံကျယ်ပြင်
ကျွတ်ဖြည့်တာ ပုံစံကျယ်ပြင် ကျွမ်းကျင်လာမည့် ပုံစံများ နှင့် JavaScript ကို သုံးပြီး ရှာဖွေစက်ကို ဖွဲ့စည်းခြင်း
ကျွတ်ဖြည့်တာ ပုံစံကျယ်ပြင် ရှာဖွေစက်
ပထမပိုင်း - HTML ထပ်ထည့်ခြင်း:
<div id="myOverlay" class="overlay"> <span class="closebtn" onclick="closeSearch()" title="Close Overlay">x</span> <div class="overlay-content"> <form action="action_page.php"> <input type="text" placeholder="Search.." name="search"> <button type="submit"><i class="fa fa-search"></i></button> </form> </div> </div>
ဒုတိယပိုင်း - CSS ထပ်ထည့်ခြင်း:
/* မိုးအရောင် နိဗ္ဗာန် တပ်ဆင်ကုန် */ .overlay { height: 100%; width: 100%; display: none; position: fixed; z-index: 1; top: 0; left: 0; background-color: rgb(0,0,0); background-color: rgba(0,0,0, 0.9); /* အနက်အိုး နှင့် ဥပမာ အတော်လေး ပြတ်တောက်နိုင်သည် (သို့မဟုတ် ပြန်ပြီး) */ } /* အရာဝတ္တု */ .overlay-content { position: relative; top: 46%; width: 80%; text-align: center; margin-top: 30px; margin: auto; } /* ပိတ်ပြရန် ဘေ့တံနှံ */ .overlay .closebtn { position: absolute; top: 20px; right: 45px; font-size: 60px; cursor: pointer; color: white; } .overlay .closebtn:hover { color: #ccc; } /* ရှာဖွေရေး ဖိုင် ပုံစံ ကို စစ်ဆေးပါ */ .overlay input[type=text] { padding: 15px; font-size: 17px; border: none; float: left; width: 80%; background: white; } .overlay input[type=text]:hover { background: #f1f1f1; } /* တင်ပြသည့် ဘေ့တံနှံ ပုံစံ ကို စစ်ဆေးပါ */ .overlay button { float: left; width: 20%; padding: 15px; background: #ddd; font-size: 17px; border: none; cursor: pointer; } .overlay button:hover { background: #bbb; }
တတိယ ဆန့်ကျင် - ဂျာမိုက် ထပ်ပေါင်းပါ
ဂျာမိုက် ကိုယ်လက်ခံ ဖွင့်နှင့် ပိတ်ပြ အကျယ်အဝန်း ရည်ရွယ်ချက်
// တက်ကြီး ရှာဖွေရေး ဖွင့်ပြီ function openSearch() { document.getElementById("myOverlay").style.display = "block"; } // တက်ကြီး ရှာဖွေရေး ပိတ်ပြီ function closeSearch() { document.getElementById("myOverlay").style.display = "none"; }