CSS အသွင်ကူးပြောင်းမှု ပိုင်ဆိုင်မှု
ဥပမာ
အကျယ်ကို 100px မှ 300px သို့ ဖြည်းဖြည်းချင်းပြောင်းရန် <div> ဒြပ်စင်တစ်ခုပေါ်တွင် ရွှေ့ပါ-
div
{
width: 100px;
transition: width 2s;
}
div:hover {
width: 300px;
}
အောက်တွင် နောက်ထပ် "စမ်းသုံးကြည့်ပါ" ဥပမာများ။
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
ပိုင်ဆိုင်မှုသည် အောက်ပါ transition
တို့အတွက် အတိုကောက်ပိုင်ဆိုင်မှုတစ်ခုဖြစ်သည်။
- အကူးအပြောင်း-ပိုင်ဆိုင်မှု
- အကူးအပြောင်းကာလ
- အကူးအပြောင်း-အချိန်-လုပ်ဆောင်ချက်
- ကူးပြောင်းမှုနှောင့်နှေးခြင်း။
မှတ်ချက်- အကူးအပြောင်းကာလ ၏ ပိုင်ဆိုင်မှု ကို အမြဲတမ်းသတ်မှတ်ပါ ၊ မဟုတ်ပါက ကြာချိန်သည် 0s ဖြစ်ပြီး၊ အကူးအပြောင်းသည် အကျိုးသက်ရောက်မှု ရှိမည်မဟုတ်ပါ။
မူလတန်ဖိုး: | 0s အားလုံး လွယ်ကူ 0s |
---|---|
အမွေဆက်ခံသည်- | မဟုတ်ဘူး |
သက်ဝင်လှုပ်ရှားနိုင်သော | မဟုတ်ဘူး ကာတွန်း အကြောင်းဖတ်ပါ။ |
ဗားရှင်း- | CSS3 |
JavaScript syntax- | အရာဝတ္ထု .style.transition="all 2s" |
Browser ပံ့ပိုးမှု
ဇယားရှိ နံပါတ်များသည် ပိုင်ဆိုင်မှုကို အပြည့်အဝထောက်ခံသည့် ပထမဆုံးဘရောက်ဆာဗားရှင်းကို သတ်မှတ်ပေးသည်။
-webkit-၊ -moz- သို့မဟုတ် -o- ဖြင့်လိုက်သောနံပါတ်များသည် ရှေ့ဆက်တစ်ခုနှင့်အလုပ်လုပ်သော ပထမဆုံးဗားရှင်းကို သတ်မှတ်ပေးသည်။
Property | |||||
---|---|---|---|---|---|
transition | 26.0 4.0 -webkit- |
10.0 | 16.0 4.0 -moz- |
6.1 3.1 -webkit- |
12.1 10.5 -o- |
CSS Syntax
transition: property duration timing-function delay|initial|inherit;
အိမ်ခြံမြေတန်ဖိုးများ
Value | Description |
---|---|
transition-property | Specifies the name of the CSS property the transition effect is for |
transition-duration | Specifies how many seconds or milliseconds the transition effect takes to complete |
transition-timing-function | Specifies the speed curve of the transition effect |
transition-delay | Defines when the transition effect will start |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
နောက်ထပ် ဥပမာများ
ဥပမာ
<input type="text">တစ်ခုသည် focus ရသောအခါ၊ အကျယ်ကို 100px မှ 250px သို့ တဖြည်းဖြည်းပြောင်းပါ
input[type=text] {
width: 100px;
transition: width .35s ease-in-out;
}
input[type=text]:focus {
width: 250px;
}
ဆက်စပ်စာမျက်နှာများ
CSS သင်ခန်းစာ- CSS အပြောင်းအရွှေ့များ
HTML DOM ရည်ညွှန်းချက်- အကူးအပြောင်း ပိုင်ဆိုင်မှု