ပုံစံ zIndex အိမ်ခြံမြေ
ဥပမာ
<img> ဒြပ်စင်တစ်ခု၏ stack အစီစဥ်ကို ပြောင်းပါ-
document.getElementById("img1").style.zIndex = "1";
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
zIndex ပိုင်ဆိုင်မှုသည် နေရာချထားသော ဒြပ်စင်တစ်ခု၏ stack အစီစဥ်ကို သတ်မှတ်ပေးသည် သို့မဟုတ် ပြန်ပေးသည်။
ပိုကြီးသော အစီအစဥ် (1) ရှိသော အရာသည် အောက်ခြေအစီအစဥ် (0) ရှိသော အခြားဒြပ်စင်တစ်ခု၏ ရှေ့တွင် အမြဲရှိသည်။
အကြံပြုချက်- နေရာချထားသောဒြပ်စင်သည် ဆွေမျိုး၊ အကြွင်းမဲ့ သို့မဟုတ် ပုံသေသတ်မှတ်ထားသည့် အနေအထားပိုင်ဆိုင်မှုပါရှိသော ဒြပ်စင်တစ်ခုဖြစ်သည်။
အကြံပြုချက်- ထပ်နေသည့်အရာများကို ဖန်တီးလိုပါက ဤပိုင်ဆိုင်မှုသည် အသုံးဝင်သည်။
Browser ပံ့ပိုးမှု
Property | |||||
---|---|---|---|---|---|
zIndex | Yes | Yes | Yes | Yes | Yes |
အထားအသို
zIndex ပိုင်ဆိုင်မှုကို ပြန်ပေးပါ။
object.style.zIndex
zIndex ပိုင်ဆိုင်မှုကို သတ်မှတ်ပါ-
object.style.zIndex = "auto|number|initial|inherit"
အိမ်ခြံမြေတန်ဖိုးများ
Value | Description |
---|---|
auto | The browser determines the stack order of the element (based on its order in the document). This is default |
number | An integer that defines the stack order of the element. Negative values are allowed |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
နည်းပညာဆိုင်ရာအသေးစိတ်
မူလတန်ဖိုး: | အော်တို |
---|---|
ပြန်ပို့တန်ဖိုး- | ဒြပ်စင်တစ်ခု၏ အစုအစီအစဉ်ကို ကိုယ်စားပြုသော စာကြောင်းတစ်ခု |
CSS ဗားရှင်း | CSS2 |
နောက်ထပ် ဥပမာများ
ဥပမာ
<div> ဒြပ်စင်တစ်ခု၏ z-index ပိုင်ဆိုင်မှုတန်ဖိုးကို ပြောင်းပါ-
document.getElementById("myDIV").style.zIndex = "-1";
ဥပမာ
<img> ဒြပ်စင်တစ်ခု၏ z-အညွှန်းပိုင်ဆိုင်မှုတန်ဖိုးကို ပြန်ပေးပါ။
alert(document.getElementById("img1").style.zIndex);
ဆက်စပ်စာမျက်နှာများ
CSS သင်ခန်းစာ- CSS နေရာချထား ခြင်း။
CSS ရည်ညွှန်းချက်- z-index ပိုင်ဆိုင်မှု
❮ စတိုင်အရာဝတ္ထု