Source

Dropdowns (Donkiliw).

Toggle contextual overlays walasa ka jɛgɛnsira lisi jira ani fɛn wɛrɛw ni Bootstrap jukɔrɔla yɔrɔ ye.

Kuma bɛɛ lajɛlen

Dropdowns bɛ se ka wuli ka bɔ ɲɔgɔn na, contextual overlays walasa ka jɛgɛnsira lisi jira ani fɛn wɛrɛw. U bɛ Kɛ ɲɔgɔndan ye ni Bootstrap 'kɔnɔ JavaScript 'kɔnɔ. U bɛ toggle ni klikɛli ye, a tɛ kɛ ni hovering ye; nin ye dilancogo latigɛlen ye ni laɲini ye .

Dropdowns bɛ jɔ mɔgɔ sabanan ka gafemarayɔrɔ dɔ kan, n’o ye Popper.js ye , min bɛ jɔyɔrɔfalen ni filɛlikɛyɔrɔw dɔnni di. Aw ye aw jija ka popper.min.js don a kɔnɔ ka kɔn Bootstrap ka JavaScript ɲɛ walima ka baara kɛ ni bootstrap.bundle.min.js/ bootstrap.bundle.jsye min kɔnɔ Popper.js bɛ sɔrɔ. Popper.js tɛ baara kɛ ka dropdownw bila navbars kɔnɔ hali ni dynamic positioning tɛ wajibiya.

N'i bɛ an ka JavaScript jɔ ka bɔ source la, a bɛ wajibiyautil.js .

Seko ni dɔnko

WAI ARIA sariya bɛ role="menu"wideyo lakika dɔ ɲɛfɔ , nka o ye kɛrɛnkɛrɛnnenya la baarakɛminɛnw ye minnu bɛ kɛwalew walima baarakɛcogo dɔw daminɛ. ARIA menu kɔnɔ, menu kɔnɔfɛnw dɔrɔn de bɛ sɔrɔ, menu kɔnɔfɛnw, arajo butɔni menu kɔnɔfɛnw, arajo butɔni kuluw, ani menu fitininw.

Faan wɛrɛ fɛ, Bootstrap ka 'sènfɛ-sɛbɛnw Dabɔra walasa u ka Kɛ fɛn bɛɛ ye ani u bɛ Se ka Kɛ ko suguya caman na ani taamaʃyɛnw jɔcogo la. Misali la, a bɛ se ka kɛ ka fɛnw dilan minnu kɔnɔ, donnakow ni sɛbɛnw maracogo wɛrɛw bɛ sɔrɔ, i n’a fɔ ɲininikɛyɔrɔw walima donsɛbɛnw. O de kama, Bootstrap tɛ makɔnɔni kɛ (wa a tɛ a yɛrɛma fara a kan) roleani fɛn dɔw la aria-minnu wajibiyalen don ARIA menu lakikaw la. Sɛbɛnnikɛlaw yɛrɛ bɛna o jogo kɛrɛnkɛrɛnnenw don a kɔnɔ.

Nka, Bootstrap bɛ dɛmɛ Dòn a kɔnɔ ka Fàra klaviyeti menu (klaviyeti) menu (klaviyeti) 'kɔnɔ-ɲɔgɔnna fanba kan, i n'a fɔ se min bɛ Se ka Taa .dropdown-itemfɛn kelen-kelen bɛɛ fɛ ni cursor (kɛrɛnkɛrɛnnenya) klaviyetiw ye ani ka menu (dakun) Dabɔ ni ESCkey (klaviyeti) ye.

Misaliw

Aw bɛ jiginɛ in ka toggle (i ka butɔni walima i ka jɛgɛn) ani jiginɛ menu siri .dropdown, walima fɛn wɛrɛ min bɛ declare position: relative;. Dropdowns bɛ se ka daminɛ ka bɔ <a>walima <button>elements walasa ka bɛn i magow ma minnu bɛ se ka kɛ.

Butɔn kelen

Single o kelen .btnbɛ Se ka Yɛlɛma ka Kɛ 'yɔrɔ ye min bɛ 'yɔrɔ la ni 'yɔrɔ dɔw ye minnu bɛ 'yɔrɔ caman 'kɔnɔ. Aw bɛ se k’u bila baara la ni <button>fɛn fila la kelen ye cogo min na, o filɛ nin ye:

<div class="dropdown">
  <button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
    Dropdown button
  </button>
  <div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
    <a class="dropdown-item" href="#">Action</a>
    <a class="dropdown-item" href="#">Another action</a>
    <a class="dropdown-item" href="#">Something else here</a>
  </div>
</div>

Ani ni <a>fɛnw ye:

<div class="dropdown">
  <a class="btn btn-secondary dropdown-toggle" href="#" role="button" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
    Dropdown link
  </a>

  <div class="dropdown-menu" aria-labelledby="dropdownMenuLink">
    <a class="dropdown-item" href="#">Action</a>
    <a class="dropdown-item" href="#">Another action</a>
    <a class="dropdown-item" href="#">Something else here</a>
  </div>
</div>

A ka fisa ni bɛɛ ye aw bɛ se ka nin kɛ ni butɔni suguya o suguya ye, aw fana:

<!-- Example single danger button -->
<div class="btn-group">
  <button type="button" class="btn btn-danger dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
    Action
  </button>
  <div class="dropdown-menu">
    <a class="dropdown-item" href="#">Action</a>
    <a class="dropdown-item" href="#">Another action</a>
    <a class="dropdown-item" href="#">Something else here</a>
    <div class="dropdown-divider"></div>
    <a class="dropdown-item" href="#">Separated link</a>
  </div>
</div>

Butɔn tila-tila

O cogo kelen na, aw bɛ butɔni tila-tilalenw dabɔ ni taamasiyɛn kelen ye ni butɔni kelen-kelenw ye, nka ni farali ye .dropdown-toggle-splitwalasa ka yɔrɔjan sɔrɔ ka ɲɛ karɛti lamini na.

An bɛ baara Kɛ ni nin kalasi wɛrɛ ye walasa ka karitɔn paddingfan fla bɛɛ la jɛgɛncogo Dɔgɔya ni 25% ye ani ka o margin-leftmin Fàrala butɔni 'kɔnɔ tuma bɛɛ kan, o Bɔ. O fɛn wɛrɛw bɛ kɛ ka karɛti bila cɛmancɛ la butɔni tilalen kɔnɔ ani ka butɔni belebele kɛrɛ fɛ, a bonya bɛnnen don.

<!-- Example split danger button -->
<div class="btn-group">
  <button type="button" class="btn btn-danger">Action</button>
  <button type="button" class="btn btn-danger dropdown-toggle dropdown-toggle-split" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
    <span class="sr-only">Toggle Dropdown</span>
  </button>
  <div class="dropdown-menu">
    <a class="dropdown-item" href="#">Action</a>
    <a class="dropdown-item" href="#">Another action</a>
    <a class="dropdown-item" href="#">Something else here</a>
    <div class="dropdown-divider"></div>
    <a class="dropdown-item" href="#">Separated link</a>
  </div>
</div>

Sizing (Sizing) kɛ

Butɔnw bɛ baara kɛ ni butɔni hakɛ bɛɛ ye, hali butɔni minnu bɛ bɔ duguma ani minnu tilalen don.

<!-- Large button groups (default and split) -->
<div class="btn-group">
  <button class="btn btn-secondary btn-lg dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
    Large button
  </button>
  <div class="dropdown-menu">
    ...
  </div>
</div>
<div class="btn-group">
  <button class="btn btn-secondary btn-lg" type="button">
    Large split button
  </button>
  <button type="button" class="btn btn-lg btn-secondary dropdown-toggle dropdown-toggle-split" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
    <span class="sr-only">Toggle Dropdown</span>
  </button>
  <div class="dropdown-menu">
    ...
  </div>
</div>

<!-- Small button groups (default and split) -->
<div class="btn-group">
  <button class="btn btn-secondary btn-sm dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
    Small button
  </button>
  <div class="dropdown-menu">
    ...
  </div>
</div>
<div class="btn-group">
  <button class="btn btn-secondary btn-sm" type="button">
    Small split button
  </button>
  <button type="button" class="btn btn-sm btn-secondary dropdown-toggle dropdown-toggle-split" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
    <span class="sr-only">Toggle Dropdown</span>
  </button>
  <div class="dropdown-menu">
    ...
  </div>
</div>

Yɔrɔ jiracogo

Dropup (Dropu) ye

A’ ye fɛnw daminɛ minnu bɛ fɛnw sanfɛ ni fɛn dɔw farali .dropupye bangebaga fɛn kan.

<!-- Default dropup button -->
<div class="btn-group dropup">
  <button type="button" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
    Dropup
  </button>
  <div class="dropdown-menu">
    <!-- Dropdown menu links -->
  </div>
</div>

<!-- Split dropup button -->
<div class="btn-group dropup">
  <button type="button" class="btn btn-secondary">
    Split dropup
  </button>
  <button type="button" class="btn btn-secondary dropdown-toggle dropdown-toggle-split" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
    <span class="sr-only">Toggle Dropdown</span>
  </button>
  <div class="dropdown-menu">
    <!-- Dropdown menu links -->
  </div>
</div>

Dropright (Dropright) ye

A’ ye fɛnw daminɛ minnu bɛ fɛnw kinin fɛ ni fɛn dɔw farali .droprightye bangebaga fɛn kan.

<!-- Default dropright button -->
<div class="btn-group dropright">
  <button type="button" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
    Dropright
  </button>
  <div class="dropdown-menu">
    <!-- Dropdown menu links -->
  </div>
</div>

<!-- Split dropright button -->
<div class="btn-group dropright">
  <button type="button" class="btn btn-secondary">
    Split dropright
  </button>
  <button type="button" class="btn btn-secondary dropdown-toggle dropdown-toggle-split" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
    <span class="sr-only">Toggle Dropright</span>
  </button>
  <div class="dropdown-menu">
    <!-- Dropdown menu links -->
  </div>
</div>

Dropleft (Dropleft) ye

Meniw minnu bɛ fɛnw jiginni na, olu daminɛ fɛnw kinin fɛ ni farali .dropleftye fɛn bangebaga kan.

<!-- Default dropleft button -->
<div class="btn-group dropleft">
  <button type="button" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
    Dropleft
  </button>
  <div class="dropdown-menu">
    <!-- Dropdown menu links -->
  </div>
</div>

<!-- Split dropleft button -->
<div class="btn-group">
  <div class="btn-group dropleft" role="group">
    <button type="button" class="btn btn-secondary dropdown-toggle dropdown-toggle-split" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
      <span class="sr-only">Toggle Dropleft</span>
    </button>
    <div class="dropdown-menu">
      <!-- Dropdown menu links -->
    </div>
  </div>
  <button type="button" class="btn btn-secondary">
    Split dropleft
  </button>
</div>

Tariku la, menu kɔnɔfɛnw tun ka kan ka kɛ jɛgɛnw ye, nka o tɛ kɛ tugun v4 la. Sisan i bɛ Se ka baara Kɛ ni <button>fɛnw ye i yɛrɛ sago la i ka 'sènfɛ-sɛbɛnw kɔnɔ <a>s dɔrɔn nɔ na.

<div class="dropdown">
  <button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenu2" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
    Dropdown
  </button>
  <div class="dropdown-menu" aria-labelledby="dropdownMenu2">
    <button class="dropdown-item" type="button">Action</button>
    <button class="dropdown-item" type="button">Another action</button>
    <button class="dropdown-item" type="button">Something else here</button>
  </div>
</div>

Aw bɛ se fana ka fɛnw dilan minnu tɛ ɲɔgɔn sɔrɔ ni .dropdown-item-text. Aw kana siga ka style kɛ ka taa a fɛ ni CSS walima sɛbɛnni nafamafɛnw ye minnu bɛ kɛ ka kɛɲɛ ni aw sago ye.

<div class="dropdown-menu">
  <span class="dropdown-item-text">Dropdown item text</span>
  <a class="dropdown-item" href="#">Action</a>
  <a class="dropdown-item" href="#">Another action</a>
  <a class="dropdown-item" href="#">Something else here</a>
</div>

Walawalalen

fara .activefɛnw kan minnu bɛ jiralan kɔnɔ walasa k ' u cogoya kɛ i n' a fɔ baarakɛtaw .

<div class="dropdown-menu">
  <a class="dropdown-item" href="#">Regular link</a>
  <a class="dropdown-item active" href="#">Active link</a>
  <a class="dropdown-item" href="#">Another link</a>
</div>

A jɔ la

aw bɛ fɛn dɔw fara .disabledɲɔgɔn kan , minnu bɛ sɔrɔ yɔrɔ la , walasa k ' u cogoya kɛ i n' a fɔ fɛn minnu tɛ se ka baara kɛ .

<div class="dropdown-menu">
  <a class="dropdown-item" href="#">Regular link</a>
  <a class="dropdown-item disabled" href="#" tabindex="-1" aria-disabled="true">Disabled link</a>
  <a class="dropdown-item" href="#">Another link</a>
</div>

O cogo la, fɛn dɔ bɛ Dòn a yɛrɛ la 100% ka Bɔ sanfɛ ani a bangebaga kinin fɛ. A fara a kan .dropdown-menu-rightka .dropdown-menutaa kinin fɛ, i ka menu (yɔrɔ) labɛn.

Kungolow bɛ wuli! Dropdowns bɛ jɔyɔrɔ la Popper.js sababu la (n’a Bɔra n’u bɛ navbar dɔ kɔnɔ).

<div class="btn-group">
  <button type="button" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
    Right-aligned menu
  </button>
  <div class="dropdown-menu dropdown-menu-right">
    <button class="dropdown-item" type="button">Action</button>
    <button class="dropdown-item" type="button">Another action</button>
    <button class="dropdown-item" type="button">Something else here</button>
  </div>
</div>

Alignment min bɛ jaabi di

N’i ​​b’a fɛ ka baara kɛ ni jaabi-labɛnni ye, i ka dynamique positionnement bali ni data-display="static"attribut farali ye ani ka baara kɛ ni responsive variation classes ye.

Walasa ka menu (yɔrɔ) min bɛ jira, o bɛ bɛn kinin fɛ ni breakpoint dilen ye walima min ka bon, i ka fara .dropdown-menu{-sm|-md|-lg|-xl}-right.

<div class="btn-group">
  <button type="button" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" data-display="static" aria-haspopup="true" aria-expanded="false">
    Left-aligned but right aligned when large screen
  </button>
  <div class="dropdown-menu dropdown-menu-lg-right">
    <button class="dropdown-item" type="button">Action</button>
    <button class="dropdown-item" type="button">Another action</button>
    <button class="dropdown-item" type="button">Something else here</button>
  </div>
</div>

Walasa ka menu (yɔrɔ) min bɛ bɔ kinin fɛ , o ni breakpoint dilen walima min ka bon ni o ye, i ka fara a kan .dropdown-menu-rightani .dropdown-menu{-sm|-md|-lg|-xl}-left.

<div class="btn-group">
  <button type="button" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" data-display="static" aria-haspopup="true" aria-expanded="false">
    Right-aligned but left aligned when large screen
  </button>
  <div class="dropdown-menu dropdown-menu-right dropdown-menu-lg-left">
    <button class="dropdown-item" type="button">Action</button>
    <button class="dropdown-item" type="button">Another action</button>
    <button class="dropdown-item" type="button">Something else here</button>
  </div>
</div>

A kɔlɔsi ko i man kan ka fɛn dɔ Fàra data-display="static"butɔni dɔw kan navbarw kɔnɔ, bawo Popper.js tɛ baara Kɛ navbarw kɔnɔ.

Kungolodilanw

Aw bɛ kuncɛ dɔ fara a kan walasa ka walew yɔrɔw tɔgɔ sɛbɛn minnu bɛ sɔrɔ yɔrɔ o yɔrɔ la.

<div class="dropdown-menu">
  <h6 class="dropdown-header">Dropdown header</h6>
  <a class="dropdown-item" href="#">Action</a>
  <a class="dropdown-item" href="#">Another action</a>
</div>

Tila-tilabagaw

Meniw kɔnɔfɛnw minnu bɛ tali kɛ ɲɔgɔn na, olu kuluw faranfasi ni tilayɔrɔba ye.

<div class="dropdown-menu">
  <a class="dropdown-item" href="#">Action</a>
  <a class="dropdown-item" href="#">Another action</a>
  <a class="dropdown-item" href="#">Something else here</a>
  <div class="dropdown-divider"></div>
  <a class="dropdown-item" href="#">Separated link</a>
</div>

Masalabolo

sɛbɛn hɔrɔnyalen o sɛbɛn hɔrɔnyalen bɛ yɔrɔ dɔ kɔnɔ ni sɛbɛnni ye ani ka baara kɛ ni yɔrɔjan nafamafɛnw ye . A kɔlɔsi ko a ka c’a la, i mago bɛna kɛ bonyacogo wɛrɛw la walasa ka menu bonya bali.

<div class="dropdown-menu p-4 text-muted" style="max-width: 200px;">
  <p>
    Some example text that's free-flowing within the dropdown menu.
  </p>
  <p class="mb-0">
    And this is more example text.
  </p>
</div>

Sɛbɛnw

I ka sɛbɛn dɔ bila fɛn dɔ kɔnɔ min bɛ jira, walima k’a kɛ fɛn dɔ ye min bɛ fɛnw jira, ani ka baara kɛ ni margin walima padding utilities ye walasa ka yɔrɔ jugu di a ma i mago bɛ min na.

<div class="dropdown-menu">
  <form class="px-4 py-3">
    <div class="form-group">
      <label for="exampleDropdownFormEmail1">Email address</label>
      <input type="email" class="form-control" id="exampleDropdownFormEmail1" placeholder="[email protected]">
    </div>
    <div class="form-group">
      <label for="exampleDropdownFormPassword1">Password</label>
      <input type="password" class="form-control" id="exampleDropdownFormPassword1" placeholder="Password">
    </div>
    <div class="form-group">
      <div class="form-check">
        <input type="checkbox" class="form-check-input" id="dropdownCheck">
        <label class="form-check-label" for="dropdownCheck">
          Remember me
        </label>
      </div>
    </div>
    <button type="submit" class="btn btn-primary">Sign in</button>
  </form>
  <div class="dropdown-divider"></div>
  <a class="dropdown-item" href="#">New around here? Sign up</a>
  <a class="dropdown-item" href="#">Forgot password?</a>
</div>
<form class="dropdown-menu p-4">
  <div class="form-group">
    <label for="exampleDropdownFormEmail2">Email address</label>
    <input type="email" class="form-control" id="exampleDropdownFormEmail2" placeholder="[email protected]">
  </div>
  <div class="form-group">
    <label for="exampleDropdownFormPassword2">Password</label>
    <input type="password" class="form-control" id="exampleDropdownFormPassword2" placeholder="Password">
  </div>
  <div class="form-group">
    <div class="form-check">
      <input type="checkbox" class="form-check-input" id="dropdownCheck2">
      <label class="form-check-label" for="dropdownCheck2">
        Remember me
      </label>
    </div>
  </div>
  <button type="submit" class="btn btn-primary">Sign in</button>
</form>

Baara kɛ ni data-offsetwala data-referenceye walasa ka yɔrɔ caman Changer.

<div class="d-flex">
  <div class="dropdown mr-1">
    <button type="button" class="btn btn-secondary dropdown-toggle" id="dropdownMenuOffset" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" data-offset="10,20">
      Offset
    </button>
    <div class="dropdown-menu" aria-labelledby="dropdownMenuOffset">
      <a class="dropdown-item" href="#">Action</a>
      <a class="dropdown-item" href="#">Another action</a>
      <a class="dropdown-item" href="#">Something else here</a>
    </div>
  </div>
  <div class="btn-group">
    <button type="button" class="btn btn-secondary">Reference</button>
    <button type="button" class="btn btn-secondary dropdown-toggle dropdown-toggle-split" id="dropdownMenuReference" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" data-reference="parent">
      <span class="sr-only">Toggle Dropdown</span>
    </button>
    <div class="dropdown-menu" aria-labelledby="dropdownMenuReference">
      <a class="dropdown-item" href="#">Action</a>
      <a class="dropdown-item" href="#">Another action</a>
      <a class="dropdown-item" href="#">Something else here</a>
      <div class="dropdown-divider"></div>
      <a class="dropdown-item" href="#">Separated link</a>
    </div>
  </div>
</div>

Baarakɛcogo

Data attributes walima JavaScript fɛ, fɛn min bɛ fɛn dɔ jira, o bɛ kunnafoni dogolenw wuli (menuw) ni .showkalan sɛgɛsɛgɛli ye bangebagaw ka lisi yɔrɔ kan. O data-toggle="dropdown"fɛnɲɛnɛma in bɛ Da a kan walasa ka 'sènfɛjuru-minɛnw Dabɔ application (application) hakɛ dɔ la, o la a ka ɲi ka baara Kɛ n'a ye tuma bɛɛ.

$.noopMinɛn minnu bɛ se ka maga u la, ni i ye fɛn dɔ da wuli, o bɛ ( ) minɛlan lankolonw fara fɛn mouseoverin denw kan minnu bɛ u yɛrɛ la <body>. O admittedly ugly hack is necessary to work around a quirk in iOS’ event delegation , min n’o tɛ, o bɛna a bali ka tap dɔ kɛ yɔrɔ o yɔrɔ la ka bɔ dropdown kɔfɛ ka kode daminɛ min bɛ dropdown datugu. Ni jiginɛ datugulen don, o minɛn lankolon wɛrɛw mouseoverbɛ bɔ.

Ka tɛmɛn donanw ka fɛnw kan

A fara a kan data-toggle="dropdown"ka kɛ yɔrɔ dɔ ye walima ka butɔni dɔ fara a kan walasa ka fɛn dɔ wuli ka bɔ a nɔ na.

<div class="dropdown">
  <button id="dLabel" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
    Dropdown trigger
  </button>
  <div class="dropdown-menu" aria-labelledby="dLabel">
    ...
  </div>
</div>

JavaScript fɛ

Aw bɛ fɛnw wele JavaScript fɛ:

$('.dropdown-toggle').dropdown()
data-toggle="dropdown"hali bi a wajibiyalen don

A mana Kɛ cogo o cogo n'i y'i ka 'dakun Weele JavaScript fɛ walima o nɔ na i bɛ baara Kɛ ni data-api ye, data-toggle="dropdown"a wajibiyalen don tuma bɛɛ ka Kɛ 'sènfɛ-sɛbɛnni-minɛn in 'kɔnɔ.

Sugandili minnu bɛ kɛ

Sugandili bɛ se ka tɛmɛ data attributes walima JavaScript fɛ. Donanw cogoyaw kama, aw bɛ sugandi tɔgɔ fara data-, i n’a fɔ a bɛ cogo min na data-offset="".

Tɔ̀gɔ Ka sɛbɛen masin na Fɔlɔ Cogojirali
offset (fɔcogo ɲuman). jate | juru | baarakunda 0 ye

Offset ka dropdown ka kɛɲɛ n’a laɲini ye.

Ni baarakɛcogo dɔ bɛ Kɛ ka 'offset (fɔcogo) Labɛn, a bɛ Weele ni fɛn dɔ ye min kɔnɔ offset (fɔcogo) data bɛ yen k'a Kɛ a ka dalilu fɔlɔ ye. Baarakɛcogo ka kan ka segin fɛn dɔ kan min jɔcogo ye kelen ye. Triggering element DOM node bɛ tɛmɛ i n’a fɔ argument filanan.

Walasa ka kunnafoni wɛrɛw sɔrɔ, aw ye Popper.js ka offset docs lajɛ .

kilape boolean ye sɛbɛ A to Dropdown ka flip ni a kɛra ko dɔ bɛ ɲɔgɔn kan reference element kan. Walasa ka kunnafoni wɛrɛw sɔrɔ, aw ye Popper.js ka flip docs lajɛ .
dankan juru | fɛn 'sɛbɛnni Bangebagaw'. Overflow constraint dancɛ min bɛ sɔrɔ fɛnw jiracogo la. A bɛ Sɔn 'viewport', 'window', 'scrollParent', walima HTMLElement ɲɛfɔli dɔ nafaw ma (JavaScript dɔrɔn). Walasa ka kunnafoni wɛrɛw sɔrɔ, aw ye Popper.js ka preventOverflow docs lajɛ .
tàyɔrɔ juru | fɛn 'toggle' ye. Reference element min bɛ sɔrɔ menu kɔnɔ. A bɛ Sɔn 'toggle', 'parent', walima HTMLElement ka ɲɛfɔli nafaw ma. Walasa ka kunnafoni wɛrɛw sɔrɔ, aw ye Popper.js ka referenceObject docs lajɛ .
ka yira gaari 'dinamiki'. Ka da a kan, an bɛ baara Kɛ ni Popper.js ye walasa ka jɔyɔrɔfalen-falen Kɛ. Nin baara in bali ni static.
popperKonfig ye null ka | minɛn fu Walasa ka Bootstrap ka Popper.js config default Changer, aw ye Popper.js ka configuration lajɛ

A kɔlɔsi ni boundarya sigilen bɛ nafa wɛrɛ la min tɛ 'scrollParent', cogoya position: staticbɛ kɛ .dropdownminɛn kɔnɔ.

Fɛɛrɛw

Kɛcogo Cogojirali
$().dropdown('toggle') A bɛ navbar walima navigation tabbed dilen dɔ ka menu dropdown wuli.
$().dropdown('show') A bɛ navbar walima navigation tabbed dilen dɔ ka menu dropdown jira.
$().dropdown('hide') A bɛ navbar walima navigation tabbed dilen dɔ ka menu dropdown dogo.
$().dropdown('update') A bɛ fɛn dɔ ka 'yɔrɔ kura ye.
$().dropdown('dispose') A bɛ element dɔ ka dropdown tiɲɛ.

Ko minnu kɛra

Fɛn minnu bɛ Dòn 'kɔnɔ olu bɛɛ bɛ Fɔ .dropdown-menu's parent element ('s parent element) la ani u bɛ ni relatedTargetnafolo ye, min nafa ye toggling anchor element ye. hide.bs.dropdownani hidden.bs.dropdownko kɛlenw bɛ ni clickEventnafolo ye (dɔrɔn ni ko kɛlen suguya fɔlɔ ye click) ye min kɔnɔ Ko kɛlen Fɛn dɔ bɛ yen min bɛ kɛ ka ɲɛsin klikɛli ko kɛlen ma.

Lajɛrɛ Cogojirali
show.bs.dropdown O ko in bɛ tasuma Bɔ o yɔrɔnin bɛɛ ni show instance fɛɛrɛ Weelera.
shown.bs.dropdown O ko in bɛ Fɔ ni 'sènbɔli Kɛra baarakɛla fɛ (a bɛna CSS 'tɛmɛsiraw makɔnɔ, ka Dafa).
hide.bs.dropdown O ko in bɛ Fɔ o yɔrɔnin bɛɛ ni hide instance fɛɛrɛ Weelera.
hidden.bs.dropdown O ko in bɛ Fɔ ni 'sènfɛ-sɛbɛn in dogolen dòn baarakɛla fɛ (a bɛna CSS 'tɛmɛsiraw makɔnɔ, ka Dafa).
$('#myDropdown').on('show.bs.dropdown', function () {
  // do something...
})