in English

Scrollspy

မည်သည့်လင့်ခ်သည် မြင်ကွင်းပို့တ်တွင် လက်ရှိအသုံးပြုနေကြောင်းညွှန်ပြရန်အတွက် လှိမ့်အနေအထားပေါ်အခြေခံ၍ Bootstrap လမ်းညွှန်မှု သို့မဟုတ် အုပ်စုအစိတ်အပိုင်းများကို စာရင်းပြုစုပါ။

ဘယ်လိုအလုပ်လုပ်လဲ

Scrollspy တွင် ကောင်းမွန်စွာလုပ်ဆောင်ရန် လိုအပ်ချက်အချို့ရှိသည်။

  • အကယ်၍ သင်သည် ကျွန်ုပ်တို့၏ JavaScript ကို အရင်းအမြစ်မှ တည်ဆောက်နေပါက၊ ၎င်းသည် လိုအပ်ပါသည်util.js
  • ၎င်းကို Bootstrap nav အစိတ်အပိုင်း သို့မဟုတ် စာရင်းအုပ်စု တွင် အသုံးပြုရပါမည် ။
  • Scrollspy သည် position: relative;သင်သူလျှိုလုပ်နေသော ဒြပ်စင်ပေါ်တွင် လိုအပ်သည်၊ များသောအားဖြင့် <body>.
  • ၎င်းမှလွဲ၍ အခြားဒြပ်စင်များကို စူးစမ်းသည့်အခါ ၊ သတ်မှတ်ချက် <body>တစ်ခုရှိရန် သေချာစေပါ ။heightoverflow-y: scroll;
  • Anchors ( <a>) လိုအပ်ပြီး ၎င်းနှင့်အတူ အစိတ်အပိုင်းတစ်ခုကို ညွှန်ပေးရပါမည် id

.activeအောင်မြင်စွာ အကောင်အထည် ဖော်သောအခါ၊ သင်၏ လမ်းကြောင်း သို့မဟုတ် စာရင်းအုပ်စု သည် ၎င်းတို့၏ ဆက်စပ်ပစ်မှတ်များကို အခြေခံ၍ အတန်းကို အကြောင်းအရာတစ်ခုမှ နောက်တစ်ခု သို့ ရွှေ့ကာ အလိုက်သင့် အပ်ဒိတ်လုပ်ပါမည် ။

navbar တွင်ဥပမာ

navbar အောက်ရှိ ဧရိယာကို ရွှေ့ပြီး တက်ကြွသော အတန်းပြောင်းလဲမှုကို ကြည့်ရှုပါ။ dropdown items များကိုလည်း မီးမောင်းထိုးပြပါမည်။

@ဖြိုး

scrollspy ဥပမာအတွက် နေရာယူထားသော အကြောင်းအရာ။ အကောင်းမွန်ဆုံး ဗိသုကာလက်ရာကို သင်ရပြီ။ ပတ်စ်ပို့တံဆိပ်ခေါင်း ၊ ကောင်းတယ်၊ လတ်ဆတ်တယ်၊ ပြင်းထန်တယ်၊ အဲဒါကို သော့ခတ်ထားတယ်။ တစ်နေ့ကျရင် မင်းကိုဆုံးရှုံးရလိမ့်မယ်လို့ ဘယ်တုန်းကမှ မကြံစည်ခဲ့ဖူးဘူး။ သူမသည် သင့်နှလုံးသားကို စုပ်ယူသည်။ မင်းရဲ့အနမ်းက နတ်မင်းကြီး၊ လှုပ်ရှားမှုတိုင်းက မှော်ဆန်တယ်။ ပြောချင်တာက သူများတွေ ၊ သူမ တယောက်လို ပြောတာ ။ ချစ်ရသူလေးတို့ရေ ခရီးထွက်ကြရအောင်နော်။ ဇူလိုင်လ 4 ရက်နေ့ကဲ့သို့ ညကိုပိုင်ဆိုင်လိုက်ပါ။ ဒါပေမယ့် မင်း အလဟသ လိုချင်ပါတယ်။

@mdo

scrollspy ဥပမာအတွက် နေရာယူထားသော အကြောင်းအရာ။ ဘာကြောင့်လဲ ဆိုတော့ သူမက မူဆယ်နဲ့ အနုပညာရှင်ပါ။ (ဒါက ငါတို့လုပ်ပုံက) ဒါဆို မင်း မှော်ပညာနဲ့ ကစားချင်လား။ ဒါကြောင့် မင်းငါ့ကို အားလုံးကို မပေးခင် သေချာအောင် ငါလမ်းလျှောက်နေတယ်၊ ​​ငါလေပေါ်မှာလမ်းလျှောက်နေတယ် (ဒီည). ဟောပြောပွဲကို ကျော်သွား၊ အားလုံးကြားလိုက်၊ လမ်းလျှောက်ဖို့ အချိန်တန်ပြီ။

တစ်ခု

Placeholder content for the scrollspy example. Takes you miles high, so high, 'cause she’s got that one international smile. There's a stranger in my bed, there's a pounding in my head. Oh, no. In another life I would make you stay. ‘Cause I, I’m capable of anything. Suiting up for my crowning battle. Used to steal your parents' liquor and climb to the roof. Tone, tan fit and ready, turn it up cause its gettin' heavy. Her love is like a drug. I guess that I forgot I had a choice.

two

Placeholder content for the scrollspy example. It's time to bring out the big balloons. I'm walking, I'm walking on air (tonight). Yeah, we maxed our credit cards and got kicked out of the bar. Yo, shout out to all you kids, buying bottle service, with your rent money. I'm ma get your heart racing in my skin-tight jeans. If you get the chance you better keep her. Yo, shout out to all you kids, buying bottle service, with your rent money.

three

scrollspy ဥပမာအတွက် နေရာယူထားသော အကြောင်းအရာ။ မင်းက ကချင်​ရင်​ အကုန်​လိုချင်​ရင်​ ငါက​ခေါ်သင့်​တဲ့ မိန်းက​လေးဆိုတာ မင်းသိတယ်​။ မုန်တိုင်းကို ဖြတ်လျှောက်ပါ့။ ဒါကြောင့် မင်းရဲ့ မွေးနေ့ဝတ်စုံကို ဝတ်ပါရစေ။ ထွက်ပြေးသွားသောတစ်ယောက်။ ပြီးခဲ့တဲ့သောကြာနေ့ညက ငါတို့က ဥပဒေကို ချိုးဖောက်တယ်ထင်တယ်၊ ငါတို့ ရပ်တော့မယ်လို့ အမြဲပြောတယ်။ သူမက Yoko နည်းနည်းလေးဆိုတော့၊ သူက နည်းနည်း 'Oh no' ပါ။ မေးရိုးပြုတ်တာ၊ မျက်လုံးပြူးတာ၊ ခေါင်းလှည့်တာ၊ ခန္ဓာကိုယ် တုန်လှုပ်နေတာ လိုချင်တယ်။ ဟုတ်ကဲ့၊ ကျွန်ုပ်တို့သည် ကျွန်ုပ်တို့၏ အကြွေးဝယ်ကတ်များကို မြှင့်တင်ပြီး ဘားမှ ထုတ်ပယ်လိုက်ပါသည်။

တိုင်းတာမှုကောင်းရန်အတွက် နောက်ထပ် နေရာယူထားသည့် အကြောင်းအရာအချို့။

<nav id="navbar-example2" class="navbar navbar-light bg-light">
  <a class="navbar-brand" href="#">Navbar</a>
  <ul class="nav nav-pills">
    <li class="nav-item">
      <a class="nav-link" href="#fat">@fat</a>
    </li>
    <li class="nav-item">
      <a class="nav-link" href="#mdo">@mdo</a>
    </li>
    <li class="nav-item dropdown">
      <a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-expanded="false">Dropdown</a>
      <div class="dropdown-menu">
        <a class="dropdown-item" href="#one">one</a>
        <a class="dropdown-item" href="#two">two</a>
        <div role="separator" class="dropdown-divider"></div>
        <a class="dropdown-item" href="#three">three</a>
      </div>
    </li>
  </ul>
</nav>
<div data-spy="scroll" data-target="#navbar-example2" data-offset="0">
  <h4 id="fat">@fat</h4>
  <p>...</p>
  <h4 id="mdo">@mdo</h4>
  <p>...</p>
  <h4 id="one">one</h4>
  <p>...</p>
  <h4 id="two">two</h4>
  <p>...</p>
  <h4 id="three">three</h4>
  <p>...</p>
</div>

nested nav ဖြင့် ဥပမာ

Scrollspy သည် nested .navs နှင့်လည်းအလုပ်လုပ်သည်။ အသိုက်တစ်ခုရှိလျှင် .nav၎င်း၏ .activeမိဘများလည်း ရှိလိမ့်မည် .active။ navbar ဘေးရှိ ဧရိယာကို ရွှေ့ပြီး တက်ကြွသော အတန်းပြောင်းလဲမှုကို ကြည့်ရှုပါ။

ပစ္စည်း ၁

scrollspy ဥပမာအတွက် နေရာယူထားသော အကြောင်းအရာ။ ဤအရာသည် အကြောင်းအရာ 1 နှင့် သက်ဆိုင်သည်။ သင့်အား မိုင်ပေါင်းများစွာ မြင့်မားစေသည်၊ အဘယ်ကြောင့်ဆိုသော် သူမသည် နိုင်ငံတကာ အပြုံးတစ်ခုကြောင့် ဖြစ်သည်။ ငါ့အိပ်ရာပေါ်မှာ သူစိမ်းတစ်ယောက်ရှိတယ်၊ ငါ့ခေါင်းထဲမှာ ခုန်နေတယ်။ အိုးမရှိ၊ နောက်ဘဝမှာ မင်းကို ငါနေခိုင်းမယ်။ ငါဘာမဆိုတတ်နိုင်လို့ပဲ။ ငါ့ရဲ့သရဖူတိုက်ပွဲအတွက် လိုက်ဖက်တယ်။ မင်းမိဘတွေရဲ့ အရက်တွေကို ခိုးပြီး အိမ်ခေါင်မိုးပေါ်တက်ခိုင်းတယ်။ လေသံ၊ အသားညိုပြီး အဆင်သင့်ဖြစ်နေပြီ၊ လေးလံလာသောကြောင့် လှန်လိုက်သည်။ သူ့အချစ်က ဆေးနဲ့တူတယ်။ ငါ့မှာ ရွေးချယ်ခွင့်ရှိတယ်ဆိုတာ မေ့နေလောက်ပြီထင်ပါတယ်။

အကြောင်းအရာ ၁-၁

scrollspy ဥပမာအတွက် နေရာယူထားသော အကြောင်းအရာ။ ဤအရာသည် 1-1 နှင့်သက်ဆိုင်သည်။ အကောင်းမွန်ဆုံး ဗိသုကာလက်ရာကို သင်ရပြီ။ ပတ်စ်ပို့တံဆိပ်ခေါင်း ၊ ကောင်းတယ်၊ လတ်ဆတ်တယ်၊ ပြင်းထန်တယ်၊ အဲဒါကို သော့ခတ်ထားတယ်။ တစ်နေ့ကျရင် မင်းကိုဆုံးရှုံးရလိမ့်မယ်လို့ ဘယ်တုန်းကမှ မကြံစည်ခဲ့ဖူးဘူး။ သူမသည် သင့်နှလုံးသားကို စုပ်ယူသည်။ မင်းရဲ့အနမ်းက နတ်မင်းကြီး၊ လှုပ်ရှားမှုတိုင်းက မှော်ဆန်တယ်။ ပြောချင်တာက သူများတွေ ၊ သူမ တယောက်လို ပြောတာ ။ ချစ်ရသူလေးတို့ရေ ခရီးထွက်ကြရအောင်နော်။ ဇူလိုင်လ 4 ရက်နေ့ကဲ့သို့ ညကိုပိုင်ဆိုင်လိုက်ပါ။ ဒါပေမယ့် မင်း အလဟသ လိုချင်ပါတယ်။

အကြောင်းအရာ ၁-၂

Placeholder content for the scrollspy example. This one relates to the item 1-2. Her love is like a drug. All my girls vintage Chanel baby. Got a motel and built a fort out of sheets. 'Cause she's the muse and the artist. (This is how we do) So you wanna play with magic. So just be sure before you give it all to me. I'm walking, I'm walking on air (tonight). Skip the talk, heard it all, time to walk the walk. Catch her if you can. Stinging like a bee I earned my stripes.

Item 2

Placeholder content for the scrollspy example. This one relates to item 2. Don't need apologies. There is no fear now, let go and just be free, I will love you unconditionally. Last Friday night. Don't be a shy kinda guy I'll bet it's beautiful. Summer after high school when we first met. 'Cause she's the muse and the artist. What? Wait. No, no, no, no. Thought that I was the exception.

Item 3

Placeholder content for the scrollspy example. This one relates to item 3. Word on the street, you got somethin' to show me, me. All this money can't buy me a time machine. Make it like your birthday everyday. So we hit the boulevard. You make me feel like I'm livin' a teenage dream, the way you turn me on Skip the talk, heard it all, time to walk the walk. Word on the street, you got somethin' to show me, me. It's no big deal, it's no big deal, it's no big deal.

Item 3-1

Placeholder content for the scrollspy example. This one relates to item 3-1. Baby do you dare to do this? This is no big deal. Yeah, you're lucky if you're on her plane. Just own the night like the 4th of July! Standing on the frontline when the bombs start to fall. So just be sure before you give it all to me.

Item 3-2

scrollspy ဥပမာအတွက် နေရာယူထားသော အကြောင်းအရာ။ ဤအရာသည် 3-2 နှင့်သက်ဆိုင်သည်။ သင်မူရင်းဖြစ်သည်၊ အစားထိုး၍မရပါ။ တစ်ညလုံး သူတို့တီးနေတယ် မင်းရဲ့သီချင်း။ ကယ်လီဖိုးနီးယားက မိန်းကလေးတွေက ငြင်းလို့မရပါဘူး။ လှောင်အိမ်မရှိသောငှက်ကဲ့သို့။ ခုတော့ မကြောက်တော့ဘူး၊ လွှတ်ချလိုက်ပြီး လွတ်လွတ်လပ်လပ် ခြွင်းချက်မရှိ ငါမင်းကို ချစ်မယ်။ နံရံမှာ ရေးထားတာကို မြင်နေရတယ်။ သင် ကမ္ဘာလှည့်ခရီးထွက်နိုင်သော်လည်း ရွှေကမ်းခြေအနီးတွင် မည်သည့်အရာမှ မရောက်ပါ။

<nav id="navbar-example3" class="navbar navbar-light bg-light">
  <a class="navbar-brand" href="#">Navbar</a>
  <nav class="nav nav-pills flex-column">
    <a class="nav-link" href="#item-1">Item 1</a>
    <nav class="nav nav-pills flex-column">
      <a class="nav-link ml-3 my-1" href="#item-1-1">Item 1-1</a>
      <a class="nav-link ml-3 my-1" href="#item-1-2">Item 1-2</a>
    </nav>
    <a class="nav-link" href="#item-2">Item 2</a>
    <a class="nav-link" href="#item-3">Item 3</a>
    <nav class="nav nav-pills flex-column">
      <a class="nav-link ml-3 my-1" href="#item-3-1">Item 3-1</a>
      <a class="nav-link ml-3 my-1" href="#item-3-2">Item 3-2</a>
    </nav>
  </nav>
</nav>

<div data-spy="scroll" data-target="#navbar-example3" data-offset="0">
  <h4 id="item-1">Item 1</h4>
  <p>...</p>
  <h5 id="item-1-1">Item 1-1</h5>
  <p>...</p>
  <h5 id="item-1-2">Item 1-2</h5>
  <p>...</p>
  <h4 id="item-2">Item 2</h4>
  <p>...</p>
  <h4 id="item-3">Item 3</h4>
  <p>...</p>
  <h5 id="item-3-1">Item 3-1</h5>
  <p>...</p>
  <h5 id="item-3-2">Item 3-2</h5>
  <p>...</p>
</div>

စာရင်းအုပ်စုနှင့် ဥပမာ

Scrollspy သည် s နှင့်လည်းအလုပ်လုပ်သည် .list-group။ စာရင်းအုပ်စုဘေးရှိ ဧရိယာကို ရွှေ့ပြီး တက်ကြွသော အတန်းပြောင်းလဲမှုကို ကြည့်ရှုပါ။

ပစ္စည်း ၁

scrollspy list-group ဥပမာအတွက် နေရာယူထားသော အကြောင်းအရာ။ ဤအရာသည် အကြောင်းအရာ 1 နှင့်သက်ဆိုင်သည်။ တောင်းပန်ရန်မလိုပါ။ ခုတော့ မကြောက်တော့ဘူး၊ လွှတ်ချလိုက်ပြီး လွတ်လွတ်လပ်လပ် ခြွင်းချက်မရှိ ငါမင်းကို ချစ်မယ်။ ပြီးခဲ့သောသောကြာည။ မရှက်မရွံ့နဲ့ လှတယ် လို့ ထင်ပါတယ်။ အထက်တန်းကျောင်းပြီးလို့ နွေရာသီမှာ ပထမဆုံးစတွေ့တာ။ ဘာကြောင့်လဲ ဆိုတော့ သူမက မူဆယ်နဲ့ အနုပညာရှင်ပါ။ ဘာ? ခဏနေ။ ခြွင်းချက်လို့ ထင်ခဲ့တာ။

ပစ္စည်း ၂

scrollspy list-group ဥပမာအတွက် နေရာယူထားသော အကြောင်းအရာ။ ဒါက အချက် 2 နဲ့ သက်ဆိုင်တယ်။ ဟုတ်တယ်၊ သူက သူ့ကိုယ်ပိုင် စည်းချက်နဲ့ ကတယ်။ အိုးမရှိ၊ မင်းက အကြီးမြတ်ဆုံးဖြစ်နိုင်တယ်။ ကလေး၊ မင်းက မီးရှူးမီးပန်းမို့လို့။ တံခါးတွေအကုန်ပိတ်ထားရတဲ့ အကြောင်းရင်းတစ်ခုလည်း ဖြစ်နိုင်တယ်။ မင်းရဲ့နှလုံးသားကိုဖွင့်ပြီး အဲဒါကိုစတင်လိုက်ပါ။ အရမ်းမိုက်တယ်၊ ဟုတ်တယ်၊ သူက classic ပဲ။

အကြောင်းအရာ ၃

scrollspy list-group ဥပမာအတွက် နေရာယူထားသော အကြောင်းအရာ။ ဤအရာသည် အကြောင်းအရာ 3 နှင့် သက်ဆိုင်ပါသည်။ ကျွန်ုပ်တို့သည် ပိုမိုမြင့်မားသွားပါသည်။ တခြားဘယ်တော့မှ မရှိဘဲနဲ့ ကျွန်တော်တို့ စာချုပ်ချုပ်တယ်။ လေပေါ်မှာ လမ်းလျှောက်နေတယ်။ သင့်တက်တူးကို ဖယ်ရှားခဲ့ကြောင်း တစ်စုံတစ်ဦးက ပြောခဲ့သည်။ အခု ငါ လိပ်ပြာလို လွင့်နေတယ်။ လေသံ၊ အသားညိုပြီး အဆင်သင့်ဖြစ်နေပြီ၊ လေးလံလာသောကြောင့် လှန်လိုက်သည်။ ဘာလို့လဲ ဆိုတော့ မင်းဟာ ငါ့ဘ၀ တစ်ချိန်က ငါ့ဘ၀မို့လို့။ အလင်းကို မီးညှိပြီး လင်းလက်ပါစေ။ အဲဒီတော့ လမ်းမကြီးကို ဝင်တိုက်တယ်။ စက္ကူပါးပါးလေး ခံစားရဖူးလား။ ငါမြင်တယ်၊ ငါမြင်တယ်။

ပစ္စည်း ၄

scrollspy list-group ဥပမာအတွက် နေရာယူထားသော အကြောင်းအရာ။ ဤအကြောင်းအရာသည် 4 နှင့် သက်ဆိုင်သည်။ အထက်တန်းကျောင်းပြီးသည့်နောက် နွေရာသီတွင် ကျွန်ုပ်တို့ ပထမဆုံးတွေ့ဆုံခဲ့သည်။ ခုတော့ မကြောက်တော့ဘူး၊ လွှတ်ချလိုက်ပြီး လွတ်လွတ်လပ်လပ် ခြွင်းချက်မရှိ ငါမင်းကို ချစ်မယ်။ နေပူလို့ နမ်းထားတဲ့ အသားအရေက မင်းရဲ့ ခဲမုန့် အရည်ပျော်သွားလိမ့်မယ်။ ဒီအချစ်က သင့်ကို လန်းဆန်းစေမှာပါ။

<div id="list-example" class="list-group">
  <a class="list-group-item list-group-item-action" href="#list-item-1">Item 1</a>
  <a class="list-group-item list-group-item-action" href="#list-item-2">Item 2</a>
  <a class="list-group-item list-group-item-action" href="#list-item-3">Item 3</a>
  <a class="list-group-item list-group-item-action" href="#list-item-4">Item 4</a>
</div>
<div data-spy="scroll" data-target="#list-example" data-offset="0" class="scrollspy-example">
  <h4 id="list-item-1">Item 1</h4>
  <p>...</p>
  <h4 id="list-item-2">Item 2</h4>
  <p>...</p>
  <h4 id="list-item-3">Item 3</h4>
  <p>...</p>
  <h4 id="list-item-4">Item 4</h4>
  <p>...</p>
</div>

အသုံးပြုမှု

ဒေတာဂုဏ်တော်များမှတဆင့်

သင်၏ topbar လမ်းညွှန်မှုတွင် scrollspy အပြုအမူကို အလွယ်တကူထည့်ရန်၊ သင် data-spy="scroll"စူးစမ်းလိုသောဒြပ်စင်သို့ ထည့်ပါ (ပုံမှန်အားဖြင့် ၎င်းသည် အများစုဖြစ်မည် <body>)။ ထို့နောက် data-targetမည်သည့် Bootstrap အစိတ်အပိုင်း၏ ပင်မဒြပ်စင် ID သို့မဟုတ် အတန်းအစား အရည်အချင်းကို ထည့်ပါ .nav

body {
  position: relative;
}
<body data-spy="scroll" data-target="#navbar-example">
  ...
  <div id="navbar-example">
    <ul class="nav nav-tabs" role="tablist">
      ...
    </ul>
  </div>
  ...
</body>

JavaScript မှတဆင့်

သင်၏ CSS တွင် ထည့်သွင်းပြီးနောက် position: relative;၊ JavaScript မှတဆင့် scrollspy ကိုခေါ်ဆိုပါ-

$('body').scrollspy({ target: '#navbar-example' })

ဖြေရှင်းနိုင်သော ID ပစ်မှတ်များ လိုအပ်သည်။

Navbar လင့်ခ်များတွင် ဖြေရှင်းနိုင်သော id ပစ်မှတ်များ ရှိရပါမည်။ ဥပမာအားဖြင့်၊ <a href="#home">home</a>DOM ကဲ့သို့သော အရာတစ်ခုနှင့် ကိုက်ညီရမည် <div id="home"></div>

ပစ်မှတ် မဟုတ်သော :visibleအရာများကို လျစ်လျူရှုထားသည်။

:visiblejQuery အရ မဟုတ်သော ပစ်မှတ်များကို လျစ်လျူရှုမည်ဖြစ်ပြီး ၎င်းတို့၏ သက်ဆိုင်ရာ nav ပစ္စည်းများကို မည်သည့်အခါမှ မီးမောင်းထိုးပြမည်မဟုတ်ပါ။

နည်းလမ်းများ

.scrollspy('refresh')

DOM မှဒြပ်စင်များထည့်ခြင်း သို့မဟုတ် ဖယ်ရှားခြင်းနှင့်အတူ scrollspy ကိုအသုံးပြုသောအခါ၊ သင်သည်ထိုကဲ့သို့သောပြန်လည်ဆန်းသစ်သည့်နည်းလမ်းကိုခေါ်ဆိုရန် လိုအပ်သည်-

$('[data-spy="scroll"]').each(function () {
  var $spy = $(this).scrollspy('refresh')
})

.scrollspy('dispose')

ဒြပ်စင်တစ်ခု၏ scrollspy ကိုဖျက်ပါ။

ရွေးချယ်မှုများ

ရွေးချယ်စရာများကို data attributes သို့မဟုတ် JavaScript မှတဆင့်ဖြတ်သန်းနိုင်သည်။ data-ဒေတာရည်ညွှန်းချက်များအတွက် ၊ တွင်ပါရှိသည့်အတိုင်း ရွေးချယ်စရာအမည်ကို ပေါင်းထည့် ပါ data-offset=""

နာမည် ရိုက်ပါ။ ပုံသေ ဖော်ပြချက်
နှိမ်သည်။ နံပါတ် ၁၀ လှိမ့်မည့် အနေအထားကို တွက်ချက်သောအခါ အပေါ်မှ ထေမိရန် ပစ်ဆယ်များ။
နည်းလမ်း ကြိုးတစ်ချောင်း အော်တို မည်သည့်အပိုင်းတွင် လျှိုလျှိုဒြပ်စင် ပါရှိသည်ကို ရှာ autoပါ။ scroll coordinates များရယူရန် အကောင်းဆုံးနည်းလမ်းကို ရွေးချယ်ပါမည်။ offsetscroll coordinates များရယူရန် jQuery offset method ကိုအသုံးပြုပါမည်။ positionscroll ကိုသြဒိနိတ်များရယူရန် jQuery အနေအထားနည်းလမ်းကို အသုံးပြုပါမည်။
ပစ်မှတ် string | jQuery object | DOM ဒြပ်စင် Scrollspy ပလပ်အင်ကို အသုံးပြုရန် အစိတ်အပိုင်းကို သတ်မှတ်သည်။

အဲ့ဒါနဲ့

ပွဲအမျိုးအစား ဖော်ပြချက်
activate.bs.scrollspy scrollspy မှ အကြောင်းအရာအသစ်တစ်ခု အသက်ဝင်လာသည့်အခါတိုင်း ဤဖြစ်ရပ်သည် လှိမ့်ဒြပ်ပေါ်တွင် မီးလောင်ပါသည်။
$('[data-spy="scroll"]').on('activate.bs.scrollspy', function () {
  // do something...
})