jQuery slideToggle() နည်းလမ်း
ဥပမာ
<p> ဒြပ်စင်အားလုံးအတွက် slideUp() နှင့် slideDown() အကြား ပြောင်းရန်
$("button").click(function(){
$("p").slideToggle();
});
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
slideToggle() နည်းလမ်းသည် ရွေးချယ်ထားသော အစိတ်အပိုင်းများအတွက် slideUp () နှင့် slideDown( ) အကြား ပြောင်းပေးသည်။
ဤနည်းလမ်းသည် ရွေးချယ်ထားသော အစိတ်အပိုင်းများကို မြင်နိုင်စွမ်းရှိစေရန် စစ်ဆေးသည်။ ဒြပ်စင်တစ်ခုဝှက်ထားလျှင် slideDown() ကို run သည်။ ဒြပ်စင်တစ်ခုကိုမြင်ပါက slideUp() ကို run သည် - ၎င်းသည် toggle effect ကိုဖန်တီးသည်။
အထားအသို
$(selector).slideToggle(speed,easing,callback)
Parameter | Description |
---|---|
speed | Optional. Specifies the speed of the slide effect. Default value is 400 milliseconds Possible values:
|
easing | Optional. Specifies the speed of the element in different points of the animation. Default value is "swing" Possible values:
|
callback | Optional. A function to be executed after the slideToggle() method is completed
To learn more about callback, visit our jQuery Callback chapter |
သင်ကိုယ်တိုင်စမ်းကြည့်ပါ - ဥပမာများ
အသုံးပြုခြင်း စလိုက်အကျိုးသက်ရောက်မှု၏ အမြန်နှုန်းကို သတ်မှတ်ရန် အမြန်နှုန်း ကန့်သတ်ဘောင်ကို အသုံးပြုနည်း။
ကိုအသုံးပြုခြင်းဖြင့် slideUp() နှင့် slideDown() အကြား toggle လုပ်သည့်အခါ callback parameter ကိုအသုံးပြုနည်း။