- Popup လုပ်နည်း
CSS နှင့် JavaScript ဖြင့် ပေါ့ပ်အပ်များ ဖန်တီးနည်းကို လေ့လာပါ။
ပေါ့ပ်အပ်ကိုပြောင်းရန် ကျွန်ုပ်ကိုနှိပ်ပါ။
ရိုးရှင်းသော ပေါ့ပ်အပ်တစ်ခု။
Popups ဖန်တီးနည်း
အဆင့် 1) HTML ကိုထည့်ပါ
ဥပမာ
<div class="popup" onclick="myFunction()">Click me!
<span class="popuptext"
id="myPopup">Popup text...</span>
</div>
အဆင့် 2) CSS ကိုထည့်ပါ
ဥပမာ
/* Popup container */
.popup {
position: relative;
display: inline-block;
cursor: pointer;
}
/* The actual popup (appears on top)
*/
.popup .popuptext
{
visibility: hidden;
width:
160px;
background-color: #555;
color: #fff;
text-align: center;
border-radius: 6px;
padding: 8px 0;
position: absolute;
z-index: 1;
bottom: 125%;
left: 50%;
margin-left: -80px;
}
/* Popup arrow */
.popup .popuptext::after {
content: "";
position: absolute;
top: 100%;
left: 50%;
margin-left: -5px;
border-width: 5px;
border-style: solid;
border-color: #555 transparent
transparent transparent;
}
/*
Toggle this class when clicking on the popup container (hide and show the
popup) */
.popup .show {
visibility: visible;
-webkit-animation:
fadeIn 1s;
animation: fadeIn 1s
}
/* Add animation (fade in the popup) */
@-webkit-keyframes fadeIn {
from {opacity: 0;}
to {opacity: 1;}
}
@keyframes fadeIn {
from {opacity: 0;}
to {opacity:1 ;}
}
အဆင့် 3) JavaScript ကိုထည့်ပါ။
ဥပမာ
<script>
// When the user clicks on <div>, open the popup
function
myFunction() {
var popup = document.getElementById("myPopup");
popup.classList.toggle("show");
}
</script>
ဆက်စပ်စာမျက်နှာများ
အကြံပြုချက်- Tooltips များသည် ပေါ့ပ်အပ်များနှင့် ဆင်တူသည်။ ကိရိယာအကြံပြုချက်များအကြောင်း လေ့လာရန် ကျွန်ုပ်တို့၏ ကိရိယာအကြံပြုချက်များ ကို ဖန်တီးနည်း ကျူတိုရီရယ် သို့ သွားပါ ။
အကြံပြုချက်- မော်ဒယ်များသည် ပေါ့ပ်အပ်များနှင့် ဆင်တူသည်။ Modals အကြောင်း လေ့လာရန် ကျွန်ုပ်တို့၏ Modals Tutorial သို့ သွားပါ ။