JavaScript ye
Bootstrap ka yɔrɔw lase ɲɛnamaya ma ni jQuery ka ladamu-minɛn tan ni fila ni kɔ ye. Aw bɛ u bɛɛ don a la nɔgɔya la, walima kelen-kelen.
Bootstrap ka yɔrɔw lase ɲɛnamaya ma ni jQuery ka ladamu-minɛn tan ni fila ni kɔ ye. Aw bɛ u bɛɛ don a la nɔgɔya la, walima kelen-kelen.
Plugins bɛ se ka don u kelen-kelen na (ka baara kɛ ni Bootstrap ka *.js
file kelen-kelenw ye), walima u bɛɛ bɛ se ka don a kɔnɔ siɲɛ kelen (ka baara kɛ ni bootstrap.js
walima ni minified bootstrap.min.js
).
U fila bɛɛ bootstrap.js
ani bootstrap.min.js
u bɛ plugins bɛɛ sɔrɔ file kelen kɔnɔ. A’ ye kelen dɔrɔn de don a kɔnɔ.
Plugin dɔw ni CSS yɔrɔ dɔw bɛ bɔ plugins wɛrɛw de la. N’i ye plugins (dakunw) Dòn u kelen-kelen na, i k’a lajɛ k’o dependencies (daɲɛw) ninnu Lajɛ docs (dɔgɔkun) kɔnɔ. Aw k’a kɔlɔsi fana ko plugins bɛɛ bɛ tali kɛ jQuery de la (o kɔrɔ ye ko jQuery ka kan ka don a kɔnɔ ka kɔn plugin files ɲɛ). Aw ye anw lajɛbower.json
walasa k’a dɔn jQuery bɔko minnu bɛ dɛmɛ.
I bɛ se ka baara kɛ ni Bootstrap plugins bɛɛ ye dɔrɔn markup API fɛ k’a sɔrɔ i ma JavaScript sɛrɛ kelen sɛbɛn. Nin ye Bootstrap ka API fɔlɔ ye wa a ka kan ka kɛ i ka jateminɛ fɔlɔ ye ni i bɛ baara kɛ ni plugin ye.
O fɔlen, ko dɔw la, a bɛ se ka kɛ ko a ka ɲi ka nin baarakɛcogo in faga. O la, an bɛ se fana Di ka data attribut API bali ni ko kɛlenw bɛɛ sirili ye sɛbɛn tɔgɔladonni kan ni data-api
. Nin bɛ i n’a fɔ nin cogo in na:
O cogo kelen na, walasa ka fɛn kɛrɛnkɛrɛnnen dɔ Laɲini, i bɛ fɛn in tɔgɔ Dòn dɔrɔn i n’a fɔ tɔgɔda-yɔrɔ ka Fàra data-api tɔgɔda-yɔrɔ kan i n’a fɔ nin:
Aw kana baara kɛ ni data attributes ye ka bɔ plugins caman na element kelen kan. Misali la, butɔni tɛ se ka kɛ ni baarakɛminɛnw ye ani ka modɛli dɔ wuli. Walasa k’o kɛ, aw bɛ baara kɛ ni fɛn dɔ ye min bɛ kɛ ka fɛnw siri.
An dalen b’a la fana ko i ka kan ka se ka baara kɛ ni Bootstrap plugins bɛɛ ye JavaScript API dɔrɔn fɛ. Foroba APIw bɛɛ ye fɛɛrɛ kelenw ye, minnu bɛ se ka siri ni cakɛda ye, ani ka segin dalajɛlen kan min waleyara.
Fɛɛrɛ bɛɛ ka kan ka sɔn sugandili fɛn dɔ ma, sɛrɛ min bɛ fɛɛrɛ kɛrɛnkɛrɛnnen dɔ laɲini, walima foyi tɛ (min bɛ fɛn dɔ daminɛ ni kɛcogo kɔrɔ ye):
Plugin kelen-kelen bɛɛ fana b’a ka raw constructor jira Constructor
nafolo dɔ kan: $.fn.popover.Constructor
. N’i b’a fɛ ka plugin instance kɛrɛnkɛrɛnnen dɔ sɔrɔ, i k’a sɔrɔ k’a ɲɛsin element dɔ ma: $('[rel="popover"]').data('popover')
.
Aw bɛ se ka fɛn dɔ labɛncogo kɔrɔw Changer ni aw ye fɛn dɔ sɛmɛntiya Constructor.DEFAULTS
:
Tuma dɔw la, a ka kan ka baara kɛ ni Bootstrap plugins ye ni UI framework wɛrɛw ye. O cogoyaw la, tɔgɔda-yɔrɔ-ko bɛ Se ka Kɛ tuma dɔw la. N'o Kɛra, i .noConflict
b'a fɛ ka plugin min nafa Lasegin, i bɛ Se k'o Weele.
Bootstrap bɛ ko kɛlenw di minnu bɛ kɛ ka kɛɲɛ ni mɔgɔw sago ye, ka ɲɛsin plugins fanba ka wale kɛrɛnkɛrɛnnenw ma. A ka c’a la, ninnu bɛ Nà daɲɛ-dafalen ni daɲɛ tɛmɛnen cogo la - daɲɛ-dafalen (ex. show
) bɛ Daminɛ yɔrɔ min na ko dɔ daminɛ na, wa a daɲɛ tɛmɛnen cogoya (ex. shown
) bɛ Daminɛ wale dɔ dafalen na.
Kabini 3.0.0, Bootstrap ko kɛlenw bɛɛ bɛ tɔgɔda-yɔrɔ la.
Ko minnu tɛ dantigɛ, olu bɛɛ bɛ preventDefault
baarakɛcogo Di. O bɛ se di ka wale dɔ waleyali jɔ sani a ka daminɛ.
Baarakɛminɛnw ni Popovers bɛ baara Kɛ ni an ka saniyalan jɔlen ye walasa ka sugandiliw saniya minnu bɛ Sɔn HTML ma.
A whiteList
nafa fɔlɔ ye nin ye:
N’i b’a fɛ ka nafa kuraw Fàra nin default in kan whiteList
i bɛ Se ka nin wale ninnu Kɛ:
N’aw b’a fɛ ka tɛmɛ an ka saniyalan kan bawo aw b’a fɛ ka baara kɛ ni gafemarayɔrɔ kɛrɛnkɛrɛnnen ye, misali la DOMPurify , aw ka kan ka nin wale ninnu kɛ:
document.implementation.createHTMLDocument
Ni navigatɛriw tɛ document.implementation.createHTMLDocument
, i n’a fɔ Internet Explorer 8, sanitize baarakɛcogo min bɛ a kɔnɔ, o bɛ HTML segin i n’a fɔ a bɛ cogo min na.
N’aw b’a fɛ ka saniya kɛ nin ko in na, aw bɛ sanitizeFn
kɛnɛma gafemarayɔrɔ dɔ jira ani ka baara kɛ ni a ye i n’a fɔ DOMPurify .
Bootstrap ka jQuery 'kɔnɔfɛn kelen-kelen bɛɛ 'sèn bɛ Se ka Sɔrɔ 'sènfɛ-sɛbɛnni-minɛn in 'kɔnɔ 'fɛn fɛ VERSION
. Misali la, baarakɛminɛnw ɲɛfɔli dakun na:
Bootstrap ka plugins tɛ bin kɔfɛ kɛrɛnkɛrɛnnenya la gracefully ni JavaScript bɛ baara la. N’i b’i janto baarakɛlaw ka ko kɛlenw na nin ko in na, i ka baara kɛ ni <noscript>
u ye walasa ka ko in ɲɛfɔ (ani JavaScript daminɛcogo kura) i ka baarakɛlaw ye, ani/walima ka i yɛrɛ ka ladamu fallbacks fara a kan.
Bootstrap tɛ JavaScript gafemarayɔrɔ wɛrɛw dɛmɛ foroba la i n’a fɔ Prototype walima jQuery UI. Hali .noConflict
ni ni tɔgɔda-ko kɛlenw bɛ yen, bɛnkan gɛlɛyaw bɛ se ka sɔrɔ minnu ka kan ka ɲɛnabɔ i yɛrɛ ma.
Walasa ka tɛmɛsira nɔgɔmanw sɔrɔ, aw bɛ transition.js
siɲɛ kelen don JS filen tɔw kɛrɛfɛ. N’i bɛ baara Kɛ ni compiled (walima minified) bootstrap.js
ye , kun t’a la k’o Dòn a la—a bɛ yen kaban.
Transition.js ye dɛmɛn jɔnjɔn ye transitionEnd
ko kɛlenw na ka fara CSS transition emulator kan. A bɛ Kɛ ni 'plugin tɔw ye walasa ka CSS 'tɛmɛsira dɛmɛni Lajɛ ani ka 'tɛmɛsira jɛgɛlenw Minɛ.
Tɛmɛsira bɛ se ka bali diɲɛ kɔnɔ ni nin JavaScript yɔrɔ in ye, min ka kan ka na transition.js
(walima bootstrap.js
walima bootstrap.min.js
, i n’a fɔ a bɛ se ka kɛ cogo min na) doni kɔfɛ:
Modalw bɛ nɔgɔya, nka u bɛ se ka wuli ka bɔ u nɔ na, kumaɲɔgɔnya ɲininkaliw ni baarakɛcogo fitinin wajibiyalenw ani defaults hakilitigiw.
Aw ye aw jija aw kana modal dɔ da wuli ka a sɔrɔ dɔ wɛrɛ bɛ ye hali bi. Modal caman jirali waati kelen na, o bɛ code custom de wajibiya.
A ɲini tuma bɛɛ ka modal dɔ ka HTML code bila sanfɛyɔrɔ la i ka sɛbɛn kɔnɔ walasa ka i yɛrɛ tanga yɔrɔ wɛrɛw ma minnu bɛ nɔ bila modal cogoya la ani/walima a baarakɛcogo la.
Kɔlɔsili dɔw bɛ yen ka ɲɛsin baara kɛli ma ni modɛliw ye telefɔni selilɛriw kan. Aw ye an ka navigatɛri dɛmɛ sɛbɛnw lajɛ walasa ka kunnafoni wɛrɛw sɔrɔ.
K’a sababu Kɛ HTML5 b’a kɔrɔfɔcogo ɲɛfɔ cogo min na, autofocus
HTML fɛnɲɛnɛma tɛ nɔ Blà Bootstrap modaliw la. Walasa ka o nɔ kelen sɔrɔ, baara kɛ ni JavaScript dɔw ye minnu bɛ kɛ ka kɛɲɛ ni mɔgɔw sago ye:
Modal rendered min bɛ ni kuncɛ, farikolo ani walew kulu ye jukɔrɔla la.
Modal dɔ wuli ka bɔ JavaScript fɛ ni i ye butɔni digi min bɛ duguma. A bɛna sɛgɛn ka jigin ka tunun ka bɔ ɲɛ sanfɛ.
Aw ye aw jija ka fara role="dialog"
ani aria-labelledby="..."
, ka modal tɔgɔ jira, ka .modal
, ani role="document"
ka fara a .modal-dialog
yɛrɛ kan.
Ka fara o kan, aw bɛ se ka ɲɛfɔli kɛ aw ka modal dialogue kan ni aria-describedby
on ye .modal
.
YouTube wideyow donli modaliw kɔnɔ, o bɛ JavaScript wɛrɛw de wajibiya minnu tɛ Bootstrap kɔnɔ walasa ka fɔli jɔ a yɛrɛma ani fɛn wɛrɛw. Aw ye nin dɛmɛnan Stack Overflow post lajɛ walasa ka kunnafoni wɛrɛw sɔrɔ.
Modalw bɛ ni hakɛ fila ye minnu bɛ se ka sugandi, minnu bɛ sɔrɔ modifier classes fɛ ka bila a kan .modal-dialog
.
Ni modaliw bɛ bɔ dɔrɔn sanni u ka fade in ka lajɛ, i ka .fade
kalasi bɔ i ka modali taamasiyɛn na.
Walasa ka nafa sɔrɔ Bootstrap grid system la modal kɔnɔ, i bɛ nest .row
s dɔrɔn de kɛ .modal-body
ka sɔrɔ ka baara kɛ ni normal grid system classes ye.
Yala butɔni kulu dɔ bɛ aw bolo minnu bɛɛ bɛ modɛli kelen daminɛ, dɔrɔn ni kɔnɔkow tɛ kelen ye dɔɔnin wa? Baara kɛ event.relatedTarget
ni HTML data-*
fɛnw ye (a bɛ se ka kɛ jQuery fɛ ) walasa ka modal kɔnɔkow caman ɲɔgɔn falen ka kɛɲɛ ni butɔni min digilen don. Aw ye Modal Events sɛbɛnw lajɛ walasa ka kunnafoni wɛrɛw sɔrɔ relatedTarget
, .
Modal plugin bɛ i ka kunnafoni dogolenw sɛgɛsɛgɛ ni ɲinini kɛra, data attributes walima JavaScript fɛ. A fana bɛ dɔ Fàra o kan .modal-open
ka ' <body>
sèn Bɔ 'sènfɛ-sɛbɛnni kɛcogo kɔrɔ la ani ka a Lawuli .modal-backdrop
walasa ka 'kùnkolo-yɔrɔ Di walasa ka modɛli jiralenw Labɔ ni 'kὲlɛ Kɛ modal kɔkan.
Modal dɔ baara k’a sɔrɔ i ma JavaScript sɛbɛn. Set data-toggle="modal"
on controleur element, i n’a fɔ butɔni, ka fara a kan data-target="#foo"
walima href="#foo"
ka target modal kɛrɛnkɛrɛnnen dɔ toggle.
Modal dɔ wele ni id myModal
ye ni JavaScript sɛrɛ kelen ye:
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-backdrop=""
.
Tɔ̀gɔ | ka sɛbɛen masin na | fɔlɔ | cogojirali |
---|---|---|---|
kɔkannakow | boolean walima jiribolo'static' |
sɛbɛ | Modal-backdrop element dɔ bɛ a kɔnɔ. O cogo kelen na, a jira static ka ɲɛsin kɔkannafɛn dɔ ma min tɛ modal da tugu click kan. |
klaviyeti ye | boolean ye | sɛbɛ | A bɛ modal da tugu ni escape key digilen don |
k'a jira | boolean ye | sɛbɛ | A bɛ modɛli jira ni a daminɛna. |
samanen | sira | nkalon | O sugandi in ma Kɛ kabini v3.3.0 wa a Bɔra v4 kɔnɔ. An bɛ ladilikan di o nɔ na ka baara kɛ ni kliyan fan fɛ jatebɔlan ye walima kunnafoni sirili karamɔgɔya ye, walima ka jQuery.load wele i yɛrɛ ye. Ni URL yɔrɔjan dɔ dira, kɔnɔkow bɛna don siɲɛ kelen jQuery ka |
.modal(options)
A bɛ i ka kɔnɔkow baara i n’a fɔ modal. A bɛ sɔn sugandiliw ma minnu bɛ se ka kɛ object
.
.modal('toggle')
A bɛ modal dɔ wuli ni bolo ye. A bɛ Segin welebaga ma sani modal ka jira tiɲɛ na walima ka dogo (o kɔrɔ ye ko sanni shown.bs.modal
walima hidden.bs.modal
ko kɛlen ka Kɛ).
.modal('show')
A bɛ modal dɔ da wuli ni bolo ye. A bɛ Segin welebaga ma sani modal ka jira tiɲɛ na (o kɔrɔ ye ko sanni ko shown.bs.modal
in ka Kɛ).
.modal('hide')
A bɛ modal dɔ dogo ni bolo ye. A bɛ Segin welebaga ma sani modɛli ka dogo tiɲɛ na (o kɔrɔ ye ko sanni ko hidden.bs.modal
in ka Kɛ).
.modal('handleUpdate')
A bɛ modɛli jɔyɔrɔ ladilan kokura walasa ka sɛrɛkili dɔ kɛlɛ ni dɔ ka kan ka bɔ, o min bɛna kɛ sababu ye ka modali ka pan ka taa kinin fɛ.
A mago bɛ dɔrɔn ni modal janya bɛ Changé ka a sɔrɔ a dabɔlen don.
Bootstrap ka modal class bɛ ko damadɔw jira kɛnɛ kan walasa ka hooking kɛ modal baarakɛcogo la.
Modal ko kɛlenw bɛɛ bɛ tasuma don modali yɛrɛ la (o kɔrɔ ye ko <div class="modal">
).
Ko kɛlen suguya | Cogojirali |
---|---|
jira.bs.modal | O ko in bɛ tasuma Bɔ o yɔrɔnin bɛɛ ni show misali fɛɛrɛ Weelela. Ni a sababu Bɔra klikɛli la, fɛn min digilen dòn, o bɛ Sɔrɔ i n’a fɔ relatedTarget ko kɛlen in nafa. |
jiralen.bs.modal | O ko in bɛ Fɔ ni modal Kɛra ka Ye baarakɛla fɛ (a bɛna CSS 'tɛmɛsiraw makɔnɔ ka Ban). Ni a sababu Bɔra klikɛli la, fɛn min digilen dòn, o bɛ Sɔrɔ i n’a fɔ relatedTarget ko kɛlen in nafa. |
dogo.bs.modal ye | O ko in bɛ Fɔ o yɔrɔnin bɛɛ ni hide misali fɛɛrɛ Weelera. |
dogolen.bs.modal | O ko in bɛ Fɔ ni modal ye dogolen Ban baarakɛla la (a bɛna CSS 'tɛmɛsiraw makɔnɔ u ka ban). |
doni.bs.modal ye | O ko in bɛ Fɔ ni modal ye kɔnɔkow Lase ni remote sugandi ye. |
Aw bɛ fɛnw fara fɛn o fɛn kan ni nin fɛn nɔgɔman in ye, i n’a fɔ navbar, tabs ani furakisɛw.
Data attributes walima JavaScript fɛ, fɛn min bɛ fɛnw jira, o bɛ kunnafoni dogolenw (menuw) wuli ka bɔ a nɔ na ni .open
kalan ye min bɛ bangebagaw ka lisi yɔrɔ kan.
Telefɔni selilɛriw kan, ka fɛn dɔ da wuli, o bɛ dɔ fara a kan .dropdown-backdrop
i n’a fɔ yɔrɔ min bɛ fɛnw digi walasa ka fɛn dɔw datugu ni i ye fɛnw digi menu kɔkan, o ye wajibi ye iOS dɛmɛni ɲuman na. O kɔrɔ ye ko n’i bɛ bɔ yɔrɔ dafalen na ka taa yɔrɔ wɛrɛ la, o bɛ ɲini ka dɔ fara i ka telefɔni selilɛri kan.
Kɔlɔsili: O data-toggle="dropdown"
fɛn in bɛ da a kan walasa ka fɛnw datugu minnu bɛ bɔ baarakɛminɛnw na, o la, a ka ɲi ka baara kɛ n’a ye tuma bɛɛ.
A fara a kan data-toggle="dropdown"
ka kɛ lien walima butɔni dɔ ye walasa ka fɛn dɔ wuli ka bɔ a nɔ na.
Walasa ka URLw to u cogo la ni jɛgɛnsira butɔni ye, i ka baara kɛ ni o data-target
fɛnsɛbɛn ye href="#"
.
Aw bɛ fɛnw wele JavaScript fɛ:
data-toggle="dropdown"
hali bi a wajibiyalen donA 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ɔ.
Foɲisi
$().dropdown('toggle')
A bɛ navbar walima navigation tabbed dilen dɔ ka menu dropdown wuli.
Fɛn minnu bɛ Dòn 'kɔnɔ, olu bɛɛ bɛ Fɔ .dropdown-menu
's parent element ('s parent element) la.
Ko kɛlenw bɛɛ bɛ ni relatedTarget
nafolo ye, min nafa ye toggling anchor element ye.
Ko kɛlen suguya | Cogojirali |
---|---|
jira.bs.dɔgɔtɔrɔso | O ko in bɛ tasuma Bɔ o yɔrɔnin bɛɛ ni show instance fɛɛrɛ Weelera. |
jiralen.bs.dropdown ye | 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). |
dogo.bs.dɔgɔtɔrɔso | O ko in bɛ Fɔ o yɔrɔnin bɛɛ ni hide instance fɛɛrɛ Weelera. |
dogolen.bs.dropdown ye | O ko in bɛ Fɔ ni 'sènfɛ-sɛbɛnni in dogolen dòn baarakɛla fɛ (a bɛna CSS 'tɛmɛsiraw makɔnɔ, ka Dafa). |
ScrollSpy plugin ye nav laɲiniw ladamuni ye a yɛrɛma ka da scroll jɔyɔrɔ kan. I ka yɔrɔ lajɛ min bɛ navbar jukɔrɔ ani ka kalansen min bɛ baara kɛ, o fɛn caman Changement lajɛ. Fɛn fitinin minnu bɛ jigin, olu fana bɛna jira.
Annonce leggings keytar, brunch id art fête dolor labore. Bamako, Mali. Pitchfork yr enim lo-fi sani u ka qui. Tumblr foro-ka-tabali bisikili josariyaw fɛn o fɛn. Anim keffiyeh carles ka karti. Velit seitan mcsweeney ka fototalan 3 waraba kalo irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui n'a sɔrɔ i ma u mɛn et cardigan fond de confiance culpa biodiesel wes anderson esthétique. Nihil tatouage accusamus, cred ironie biodiesel keffiyeh artisan ullamco consequat.
Veniam marfa moustache skateboard, adipisicing fugiat velit fourchette barbe. Freegan kunsigi aliqua cupidatat mcsweeney ka vero. Cupidatat naani loko nisi, ea helvetica nulla carles. Tatouage cosby sweater dumuni camion, mcsweeney ka quis non freegan vinyl. Lo-fi wes anderson +1 ye fɛn ye min bɛ se ka kɛ. Carles non esthétique exercice quis gentrify. Bamako, Mali. Brooklyn adipisicing bololabaarakɛlaw ka biyɛri vice keytar deserunt.
Occaecat komodo min bɛ wele ko aliqua delectus. Fap artisanat bière deserunt skateboard ea. Lomo bisikili josariyaw adipisicing banh mi, velit ea sunt nivo nata locavore kafe kelen-kelen na magna veniam. Vinyle id de haute vie, écho parc consequat quis aliquip banh mi fourchette. Vero VHS ye farikolojɔli dumuniw ye. Consectetur nisi DIY mini cidenw ka sakɔsi. Cred ex in, delectus consectetur fanny pack iphone ka baara sabatili ye.
In incididunt echo park, officia deserunt mcsweeney's proident master cleanse thundercats sapiente veniam. Excepteur VHS elit, proident shoreditch +1 biodiesel laborum craft beer. Single-origin coffee wayfarers irure four loko, cupidatat terry richardson master cleanse. Assumenda you probably haven't heard of them art party fanny pack, tattooed nulla cardigan tempor ad. Proident wolf nesciunt sartorial keffiyeh eu banh mi sustainable. Elit wolf voluptate, lo-fi ea portland before they sold out four loko. Locavore enim nostrud mlkshk brooklyn nesciunt.
Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.
Keytar twee blog, culpa ciden sakɔsi marfa fɛn o fɛn delectus dumuni kamiyɔn. Sapiente sinteti id assumenda. Locavore sed helvetica cliche irony, sanpɛrɛnw i bɛ se ka u ma mɛn u la consequat hoodie gluten-free lo-fi fap aliquip. Laboure elit placeat sanni u ka feere ka ban, terry richardson proident brunch nesciunt quis cosby sweater pariatur keffiyeh ut helvetica artisan. Cardigan artisanat bière seitan labɛnnen velit. VHS chambray laboris ye muso ye min bɛ wele ko veniam tempor. Anim mollit minim commodo ullamco sanpɛrɛnw.
Navbar jɛgɛnw ka kan ka kɛ ni id laɲiniw ye minnu bɛ se ka ɲɛnabɔ. Misali la, a <a href="#home">home</a>
ka kan ka bɛn fɛn dɔ ma DOM kɔnɔ i n’a fɔ <div id="home"></div>
.
:visible
laɲini ye, olu ma jateLaɲinifɛnw minnu tɛ :visible
ka kɛɲɛ ni jQuery ye , olu bɛna jate ani u nav fɛnw bɛnninw tɛna jira abada.
A kɛcogo mana kɛ min o min ye, scrollspy bɛ baara kɛ ni position: relative;
o ye i bɛ ka fɛn min sɛgɛsɛgɛ. A ka c' a la nin ye <body>
. Ni i bɛ scrollspying kɛ fɛn wɛrɛw kan minnu tɛ <body>
, i jija ka height
set sɔrɔ ani ka overflow-y: scroll;
baara kɛ.
Walasa ka scrollspy kɛcogo fara nɔgɔya la i ka topbar navigation kan, data-spy="scroll"
i b’a fɛ ka spy min kɛ, i ka fara o kan (a ka c’a la nin bɛna kɛ <body>
). O kɔ fɛ, i bɛ fɛn in Fàra a kan data-target
ni Bootstrap .nav
yɔrɔ o yɔrɔ bangebaga-yɔrɔ ID walima a kalasi ye.
I kɛlen kɔ ka fara position: relative;
i ka CSS kan, i ka scrollspy wele JavaScript fɛ:
.scrollspy('refresh')
Ni aw bɛ baara kɛ ni scrollspy ye ka fara fɛnw farali walima u bɔli kan DOM kɔnɔ, aw bɛna a ɲini ka refresh fɛɛrɛ wele i n’a fɔ:
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). | nimɔrɔ | 10 ye | Pixels ka offset ka bɔ sanfɛ ni jatebɔ jɔyɔrɔ scroll. |
Ko kɛlen suguya | Cogojirali |
---|---|
ka baara kɛ.bs.scrollspy ye | O ko in bɛ tasuma Bɔ tuma o tuma ni fɛn kura dɔ Kɛra baara la scrollspy fɛ. |
Tab baarakɛcogo teliyalen, fangama dɔ fara a kan walasa ka tɛmɛ ni sigida kɔnɔkow pannew ye, hali ni fɛnw ye minnu bɛ jigin. Tablo nested tɛ dɛmɛn.
Raw denim i bɛ se ka u ma mɛn u jean shorts Austin. Nesciunt tofu stumptown aliqua, retro sinteti master saniya. Moustache cliche tempor, williamsburg carles ka helvetica sogo-minɛ. Reprehenderit butcher retro keffiyeh sugo minɛbaga synth. Cosby sweater eu banh mi, qui irure terry richardson ex calmar. Bamako, Mali. Aliquip placeat ka baara kɛ ni iphone ye. Seitan aliquip quis cardigan ameriki fini, sogo feerela voluptate nisi qui.
Food truck fixie locavore, accusamus mcsweeney's marfa nulla single-origin coffee squid. Exercitation +1 labore velit, blog sartorial PBR leggings next level wes anderson artisan four loko farm-to-table craft beer twee. Qui photo booth letterpress, commodo enim craft beer mlkshk aliquip jean shorts ullamco ad vinyl cillum PBR. Homo nostrud organic, assumenda labore aesthetic magna delectus mollit. Keytar helvetica VHS salvia yr, vero magna velit sapiente labore stumptown. Vegan fanny pack odio cillum wes anderson 8-bit, sustainable jean shorts beard ut DIY ethical culpa terry richardson biodiesel. Art party scenester stumptown, tumblr butcher vero sint qui sapiente accusamus tattooed echo park.
Etsy mixtape wayfarers, ethical wes anderson tofu before they sold out mcsweeney's organic lomo retro fanny pack lo-fi farm-to-table readymade. Messenger bag gentrify pitchfork tattooed craft beer, iphone skateboard locavore carles etsy salvia banksy hoodie helvetica. DIY synth PBR banksy irony. Leggings gentrify squid 8-bit cred pitchfork. Williamsburg banh mi whatever gluten-free, carles pitchfork biodiesel fixie etsy retro mlkshk vice blog. Scenester cred you probably haven't heard of them, vinyl craft beer blog stumptown. Pitchfork sustainable tofu synth chambray yr.
Trust fund seitan letterpress, keytar raw denim keffiyeh etsy art party before they sold out master cleanse gluten-free squid scenester freegan cosby sweater. Fanny pack portland seitan DIY, art party locavore wolf cliche high life echo park Austin. Cred vinyl keffiyeh DIY salvia PBR, banh mi before they sold out farm-to-table VHS viral locavore cosby sweater. Lomo wolf viral, mustache readymade thundercats keffiyeh craft beer marfa ethical. Wolf salvia freegan, sartorial keffiyeh echo park vegan.
Nin plugin in bɛ tabbed navigation component janya walasa ka tabable yɔrɔw fara a kan.
Tabable tabs daminɛ JavaScript fɛ (tab kelen-kelen bɛɛ ka kan ka baara kɛ kelen-kelen):
Aw bɛ se ka tablo kelen-kelen bɛɛ baara cogo caman na:
I bɛ se ka tab walima pill navigation dɔ baara k’a sɔrɔ i ma JavaScript si sɛbɛn ni i ye element dɔ jira dɔrɔn data-toggle="tab"
walima a kan. ni kalansenw data-toggle="pill"
farala tablo kan , o bɛna Bootstrap tab cogoya waleya , ka sɔrɔ ka kalansenw fara a kan , o bɛna furakisɛw cogoya kɛ .nav
nav-tabs
ul
nav
nav-pills
Walasa ka tablow kɛ u ka fade in na, i ka dɔ fara .fade
u kelen-kelen bɛɛ .tab-pane
kan . Tablo fɔlɔ fana ka kan .in
ka kɛ sababu ye ka fɔlɔ kɔnɔkow kɛ fɛn ye min bɛ ye.
$().tab
A bɛ tab element ni kɔnɔkow minɛn dɔ baara. Tab ka kan ka kɛ ni a ye data-target
walima ni href
targeting a container node ye DOM kɔnɔ. Misali minnu fɔra sanfɛ, tablow ye <a>
s ye minnu bɛ ni data-toggle="tab"
fɛnɲɛnɛmaw ye.
.tab('show')
A bɛ tablo dilen sugandi ani k’a kɔnɔkow jira minnu bɛ tali kɛ a la. Tab wɛrɛ o wɛrɛ min tun sugandira ka tɛmɛ, o bɛ kɛ sugandibali ye ani a kɔnɔkow bɛ dogo. A bɛ Segin welebaga ma sanni tab pane ka jira tiɲɛ na (o kɔrɔ ye ko sanni ko shown.bs.tab
in ka Kɛ).
Ni tab kura jira, ko kɛlenw bɛ tasuma don nin cogo la:
hide.bs.tab
(tab min bɛ baara la sisan)show.bs.tab
(tabu min bɛna jira, o kan)hidden.bs.tab
(tab active tɛmɛnen kan, o ni hide.bs.tab
ko kɛlen ta ye kelen ye)shown.bs.tab
(tab min jiralen don sisan, o min bɛ baara kura kɛ, o ni show.bs.tab
ko kɛlen ta ye kelen ye)Ni tab si tun tɛ baara la kaban, o tuma na hide.bs.tab
ani hidden.bs.tab
ko kɛlenw tɛna ci.
Ko kɛlen suguya | Cogojirali |
---|---|
jira.bs.tab la | Nin ko in bɛ tasuma don tab jirali la, nka sanni tab kura ka jira. Baara kɛ event.target ni ani event.relatedTarget ye walasa ka tablo active ani tab active tɛmɛnen (ni o bɛ sɔrɔ) laɲini. |
jiralen.bs.tab ye | Nin ko in bɛ tasuma don tab jirali la tab jiralen kɔfɛ. Baara kɛ event.target ni ani event.relatedTarget ye walasa ka tablo active ani tab active tɛmɛnen (ni o bɛ sɔrɔ) laɲini. |
dogo.bs.tab ye | O ko in bɛ tasuma Bɔ ni tablo kura dɔ ka kan ka jira (wa o cogo la tab baarakɛta tɛmɛnen ka kan ka dogo). Baara kɛ event.target ni ani event.relatedTarget ye walasa ka tab min bɛ baara la sisan ani tab kura min bɛna kɛ sɔɔni, o laɲini, o cogo kelen na. |
dogolen.bs.tab ye | O ko in bɛ tasuma Bɔ tab kura jiralen kɔ (wa o cogo la tab baarakɛta tɛmɛnen bɛ dogo). Baara kɛ event.target ni ani event.relatedTarget ye walasa ka tab baarakɛta tɛmɛnen ni tab baarakɛta kura laɲini, o cogo kelen na. |
A lawulilen don ni jQuery.tipsy plugin ɲumanba ye min sɛbɛnna Jason Frame fɛ; Baarakɛminɛnw ye sɛgɛsɛgɛli kura ye, minnu tɛ u jigi da jaw kan, u bɛ baara kɛ ni CSS3 ye animationw kama, ani data-attributes sigida tɔgɔw marali kama.
Baarakɛminɛn minnu tɔgɔw janya ye zeru ye, olu tɛ jira abada.
I bolo digi jukɔrɔla yɔrɔw kan walasa ka baarakɛminɛnw lajɛ:
Tight pants next level keffiyeh n'a sɔrɔla i ma u mɛn. Foto cabine barbe cru denim letterpress vegan ciden sac stumptown. Foro-ka-tabali seitan, mcsweeney ka fixie sabatilen quinoa 8-bit ameriki finiw bɛ ni terry richardson vinyl chambray ye. Barbu stumptown, cardigans banh mi lomo sanpɛrɛnw. Tofu biodiesel williamsburg marfa, naani loko mcsweeney ka saniya vegan chambray. A tiɲɛ na ironic artisan whatever keytar , scenester foro-ka-tabali banksy Austin twitter bolo freegan cred raw denim kelen-origin kafe viral.
Sugandili naani bɛ yen: sanfɛ, kinin fɛ, duguma ani numan fɛ.
Baarakɛcogo kunw na, Tooltip ani Popover data-apis ye opt-in ye, o kɔrɔ ye ko i yɛrɛ ka kan k’u daminɛ .
Baarakɛminɛnw bɛɛ daminɛcogo dɔ ye ɲɛ dɔ kan o ye k’u sugandi u data-toggle
cogoya fɛ:
Baarakɛminɛnw-kumasenw bɛ kɔnɔkow ni taamasiyɛnw Bɔ ɲinini na, wa a bɛ baarakɛminɛnw bila u ka trigger element kɔfɛ.
Baarakɛminɛn in daminɛ JavaScript fɛ:
Taamaʃyɛn wajibiyalen min bɛ Kɛ baarakɛminɛn dɔ la o ye data
fɛnɲɛnɛma dɔrɔn de ye wa title
HTML yɔrɔ kan i b’a fɛ ka baarakɛminɛnw Sɔrɔ. Baarakɛminɛn dɔ taamasiyɛn min Sɔrɔla o ka nɔgɔn kosɛbɛ, hali n’a bɛ jɔyɔrɔ dɔ de wajibiya (a daminɛ na, a bɛ Blà ‘sèn na top
ni ‘plugin ye).
Tuma dɔw la, i b’a fɛ ka baarakɛminɛn dɔ fara jɛgɛnsira dɔ kan min bɛ zana caman siri. Baarakɛminɛnw-kumasen-minɛn in kɛcogo kɔrɔ ye k’a cɛmancɛ Kɛ jɛgɛn ni jɛgɛn-yɔrɔ la. Aw bɛ dɔ fara white-space: nowrap;
aw ka ankɔriw kan walasa aw kana o kɛ.
Ni aw bɛ baara kɛ ni baarakɛminɛnw ye fɛnw kan minnu bɛ a .btn-group
walima an kɔnɔ .input-group
, walima fɛnw kan minnu bɛ tali kɛ tabali la ( <td>
, <th>
, <tr>
, <thead>
, <tbody>
, <tfoot>
), aw bɛna sugandili jira container: 'body'
(sɛbɛn min bɛ duguma) walasa ka aw tanga kɔlɔlɔw ma minnu man ɲi (i n’a fɔ fɛn in bɛ bonya ka taa a fɛ ani/ walima a bɛ bɔnɛ a nkɔni bulamaw na ni baarakɛminɛnw bɛ daminɛ).
Baarakɛlaw minnu bɛ taama ni klaviyeti ye, ani kɛrɛnkɛrɛnnenya la dɛmɛni fɛɛrɛw baarakɛlaw fɛ, i ka kan ka baarakɛminɛnw dɔrɔn de fara klaviyeti sinsin fɛnw kan i n’a fɔ jɛgɛnsira, foroko kɔrɔsibagaw, walima fɛn o fɛn bɛ se ka kɛ ni fɛn dɔ tabindex="0"
ye.
Walasa ka baarakɛminɛn dɔ Fàra a disabled
walima .disabled
fɛn dɔ kan, i bɛ fɛn in Dòn a kɔnɔ <div>
k’a baarakɛminɛn in Kɛ o <div>
nɔ na.
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-animation=""
.
A kɔlɔsi ko lakana kunw kosɔn sanitize
, sanitizeFn
ani whiteList
sugandiliw tɛ se ka di ni data attributes ye.
Tɔ̀gɔ | Ka sɛbɛen masin na | Fɔlɔ | Cogojirali |
---|---|---|---|
animation (ɲɛnamaya kɛcogo ɲuman). | boolean ye | sɛbɛ | CSS fade transition (CSS fade transition) dɔ kɛ baarakɛminɛnw yɔrɔ la |
minɛn kɔnɔ | juru | nkalon | nkalon | A bɛ baarakɛminɛnw ɲɛfɔli fara fɛn kɛrɛnkɛrɛnnen dɔ kan. Misali la: |
ka mɛ | jate | minɛn | 0 ye | Baarakɛminɛnw jiracogo ni a dogocogo latɛmɛni (ms) - o tɛ tali kɛ bololabaarakɛminɛn suguya la Ni nimɔrɔ dɔ dira, delay bɛ kɛ hide/show fila bɛɛ la Fɛnw jɔcogo ye: |
html ye | boolean ye | nkalon | HTML don baarakɛminɛnw kɔnɔ. Ni nkalon don, jQuery ka text fɛɛrɛ bɛna kɛ ka kɔnɔkow don DOM kɔnɔ. Baara kɛ ni sɛbɛnni ye ni i bɛ hami XSS binkanniw na. |
bilali sen kan | juru | baarakunda | 'san fɛ' | Baarakɛminɛnw bilacogo - sanfɛ | duguma | kinin fɛ | kinin fɛ | auto. Ni baarakɛcogo dɔ bɛ Kɛ ka yɔrɔ-yɔrɔ-ko Labɛn, a bɛ Weele ni baarakɛminɛn-sɛbɛn DOM node ye a ka dalilu fɔlɔ ye ani 'fɛn min bɛ Daminɛ DOM node ye k'o Kɛ a filanan ye. A |
sugandilikɛla | gaari | nkalon | Ni sugandili dɔ dira, baarakɛminɛnw ɲɛfɔli fɛnw bɛna di laɲini kofɔlenw ma. Tiɲɛ na, o bɛ kɛ ka baarakɛminɛnw fana waleya DOM fɛnw kan minnu bɛ fara ɲɔgɔn kan ni fanga ye ( jQuery.on dɛmɛ). Aw ye nin lajɛ ani misali min bɛ kunnafoni di . |
jatebɔlan | gaari | '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>' |
Base HTML ka baara kɛ ni baarakɛminɛnw ɲɛfɔli ye. Baarakɛminɛnw
Kɛnɛma-datugulan-minɛn ka kan ka kɛ ni |
titiri | juru | baarakunda | '' '' . | Title nafa dafalen ni Ni baarakɛcogo dɔ dira, a bɛ Weele n'a ka |
ka ci | gaari | 'hover focus' ye. | Baarakɛminɛnw ɲɛfɔli bɛ daminɛ cogo min na - i ka | digi hover | sinsinnan | min bɛ fɛn bolo la. Aw bɛ se ka tɛmɛ fɛn caman fɛ minnu bɛ se ka kɛ sababu ye; u fara ɲɔgɔn kan ni yɔrɔ dɔ ye. manual tɛ se ka fara ɲɔgɔn kan ni fɛn wɛrɛ ye min bɛ se ka kɛ sababu ye. |
filɛlikɛyɔrɔ | juru | fɛn min bɛ kɛ | baarakunda | { sugandili: 'farikolo', padding: 0 } . | A bɛ baarakɛminɛn in mara o fɛn in dancɛw kɔnɔ. Misali: Ni baara dɔ dira, a bɛ Weele ni 'fɛn min bɛ 'sèn Bɔ a la DOM node (dakun) min ye a ka dalilu kelen ye. A |
ka saniya kɛ | boolean ye | sɛbɛ | Saniyali in daminɛ walima k’a bali. Ni activated 'template' , 'content' ani 'title' sugandiliw bɛna saniya. |
whiteList ye | minɛn | Nafa min bɛ sɔrɔ a daminɛ na | Fɛn min bɛ ni fɛnw ni taamasiyɛnw ye minnu bɛ Sɔ̀rɔ |
sanitizeFn | null ka | baarakunda | fu | Yan aw bɛ se ka aw yɛrɛ ka sanitize baarakɛcogo di. O bɛ se ka kɛ nafa ye ni aw b’a fɛ ka baara kɛ ni gafemarayɔrɔ kɛrɛnkɛrɛnnen ye walasa ka saniya kɛ. |
Sugandili minnu bɛ kɛ baarakɛminɛn kelen-kelen bɛɛ la, olu bɛ se ka ɲɛfɔ cogo wɛrɛ la ni kunnafonidilanw cogoyaw ye, i n’a fɔ a ɲɛfɔlen don cogo min na sanfɛ.
$().tooltip(options)
A bɛ baarakɛminɛn dɔ nɔrɔ fɛnw lajɛlen dɔ la.
.tooltip('show')
A bɛ element dɔ ka baarakɛminɛnw jira. A bɛ Segin welebaga ma sani baarakɛminɛn in ka jira tiɲɛ na (o kɔrɔ ye ko sani ko shown.bs.tooltip
in ka Kɛ). O bɛ jate "manuel" triggering ye baarakɛminɛnw ɲɛfɔli la. Baarakɛminɛn minnu tɔgɔw ye zeru janya ye, olu tɛ jira abada.
.tooltip('hide')
A bɛ fɛn dɔ ka baarakɛminɛn dɔ dogo. A bɛ Segin welebaga ma sani baarakɛminɛn in ka dogo tiɲɛ na (o kɔrɔ ye ko sani ko hidden.bs.tooltip
in ka Kɛ). O bɛ jate "manuel" triggering ye baarakɛminɛnw ɲɛfɔli la.
.tooltip('toggle')
A bɛ fɛn dɔ ka baarakɛminɛnw sɛgɛsɛgɛli wuli. A bɛ Segin welebaga ma sani baarakɛminɛn in ka jira tiɲɛ na walima ka dogo (o kɔrɔ ye ko sanni shown.bs.tooltip
walima hidden.bs.tooltip
ko kɛlen ka Kɛ). O bɛ jate "manuel" triggering ye baarakɛminɛnw ɲɛfɔli la.
.tooltip('destroy')
A bɛ fɛn dɔ ka baarakɛminɛn dɔ dogo ani k’a Tiɲɛ. Baarakɛminɛn minnu bɛ baara Kɛ ni delegation ye (minnu bɛ Dabɔ ni option selector
ye ) tɛ Se ka Tiɲɛ kelen-kelen bɔnsɔn trigger elements kan.
Ko kɛlen suguya | Cogojirali |
---|---|
jira.bs.baarakɛminɛnw | O ko in bɛ tasuma Bɔ o yɔrɔnin bɛɛ ni show misali fɛɛrɛ Weelela. |
jiralen.bs.baarakɛminɛnw ɲɛfɔli | O ko in bɛ Lawuli ni baarakɛminɛnw ɲɛfɔli Kɛra baarakɛla fɛ (a bɛna CSS 'tɛmɛsiraw makɔnɔ u ka ban). |
dogo.bs.baarakɛminɛnw ɲɛfɔli | O ko in bɛ Fɔ o yɔrɔnin bɛɛ ni hide misali fɛɛrɛ Weelera. |
dogolen.bs.baarakɛminɛnw ɲɛfɔli | O ko in bɛ Fɔ ni baarakɛminɛnw dogolen ye baarakɛla la (a bɛna CSS 'tɛmɛsiraw makɔnɔ u ka ban). |
inserted.bs.baarakɛminɛnw ɲɛfɔli | O ko in bɛ Bɔ ko kɛlen kɔfɛ show.bs.tooltip ni baarakɛminɛnw jatebɔlan Fàrala DOM kan. |
Aw bɛ kɔnɔkow dacogo misɛnninw fara ɲɔgɔn kan, i n’a fɔ iPad kan, fɛn o fɛn na walasa ka kunnafoni filananw sigi.
Popovers minnu tɔgɔ ni u kɔnɔkow bɛɛ ye zeru-janya ye, olu tɛ jira abada.
Popovers bɛ tooltip plugin de wajibiya ka don i ka Bootstrap version kɔnɔ.
Baarakɛcogo kunw na, Tooltip ani Popover data-apis ye opt-in ye, o kɔrɔ ye ko i yɛrɛ ka kan k’u daminɛ .
Popoverw bɛɛ daminɛcogo dɔ ɲɛ dɔ kan o ye k’u sugandi u ka data-toggle
fɛnɲɛnɛma fɛ:
Ni i bɛ baara kɛ ni popovers ye fɛnw kan a .btn-group
walima an kɔnɔ .input-group
, walima fɛnw kan minnu bɛ tali kɛ tabali la ( <td>
, <th>
, <tr>
, <thead>
, <tbody>
, <tfoot>
), i bɛna sugandili jira container: 'body'
(sɛbɛn min bɛ duguma) walasa ka i yɛrɛ tanga kɔlɔlɔw ma minnu man ɲi (i n’a fɔ fɛn in bɛ bonya ka taa a fɛ ani/ walima ka bɔnɛ a nkɔni bulamaw la ni popover daminɛna).
Walasa ka popover dɔ fara a disabled
walima .disabled
element kan, aw bɛ element in don a kɔnɔ <div>
ka popover kɛ o <div>
nɔ na.
Tuma dɔw la i b’a fɛ ka popover dɔ fara hyperlink kan min bɛ zana caman siri. Popover plugin ka taamacogo fɔlɔ ye k'a cɛmancɛ Kɛ 'yɔrɔ la ani 'yɔrɔ la. Aw bɛ dɔ fara white-space: nowrap;
aw ka ankɔriw kan walasa aw kana o kɛ.
Sugandili naani bɛ yen: sanfɛ, kinin fɛ, duguma ani numan fɛ.
Sed posuere consectetur est ka bɔ lobortis la. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum (banakisɛfagalan min bɛ wele ko lacinia quam venenatis vestibulum).
Sed posuere consectetur est ka bɔ lobortis la. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum (banakisɛfagalan min bɛ wele ko lacinia quam venenatis vestibulum).
Sed posuere consectetur est ka bɔ lobortis la. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum (banakisɛfagalan min bɛ wele ko lacinia quam venenatis vestibulum).
Sed posuere consectetur est ka bɔ lobortis la. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum (banakisɛfagalan min bɛ wele ko lacinia quam venenatis vestibulum).
Baara kɛ ni focus
trigger ye walasa ka popovers (popovers) bɔ kɛnɛ kan baarakɛla bɛ min kɛ digi nata la.
Walasa ka cross-browser ni cross-platform kɛcogo ɲuman sɔrɔ, i ka kan ka baara kɛ ni <a>
tag ye, i kana baara kɛ ni <button>
tag ye, wa i ka kan fana ka role="button"
and tabindex
attributes don a kɔnɔ.
Popovers baara kɛ JavaScript fɛ:
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-animation=""
.
A kɔlɔsi ko lakana kunw kosɔn sanitize
, sanitizeFn
ani whiteList
sugandiliw tɛ se ka di ni data attributes ye.
Tɔ̀gɔ | Ka sɛbɛen masin na | Fɔlɔ | Cogojirali |
---|---|---|---|
animation (ɲɛnamaya kɛcogo ɲuman). | boolean ye | sɛbɛ | CSS fade transition dɔ kɛ ka popover kɛ |
minɛn kɔnɔ | juru | nkalon | nkalon | A bɛ popover fara fɛn kɛrɛnkɛrɛnnen dɔ kan. Misali la: |
kɔnɔnafɛn | juru | baarakunda | '' '' . | Kɔnɔkow nafa dafalen ni Ni baara dɔ dira, a bɛ Weele n'a ka |
ka mɛ | jate | minɛn | 0 ye | Delay jirali ni a dogo popover (ms) - o tɛ tali kɛ bololabaarakɛlaw ka trigger suguya la Ni nimɔrɔ dɔ dira, delay bɛ kɛ hide/show fila bɛɛ la Fɛnw jɔcogo ye: |
html ye | boolean ye | nkalon | HTML don popover kɔnɔ. Ni nkalon don, jQuery ka text fɛɛrɛ bɛna kɛ ka kɔnɔkow don DOM kɔnɔ. Baara kɛ ni sɛbɛnni ye ni i bɛ hami XSS binkanniw na. |
bilali sen kan | juru | baarakunda | 'jo' | Cogo min na ka popover sigi - sanfɛ | duguma | kinin fɛ | kinin fɛ | auto. Ni baarakɛcogo dɔ bɛ Kɛ ka jɔyɔrɔko Labɛn, a bɛ Weele ni popover DOM node ye a ka argument fɔlɔ ye ani triggering element DOM node k'a Kɛ a filanan ye. A |
sugandilikɛla | gaari | nkalon | Ni sugandili dɔ dira, popover fɛnw bɛna di laɲini kofɔlenw ma. Tiɲɛ na, o bɛ Kɛ walasa ka HTML kɔnɔkow dinamikilenw Dɛmɛ ka popovers (popovers) Fàra u kan. Aw ye nin lajɛ ani misali min bɛ kunnafoni di . |
jatebɔlan | gaari | '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>' |
Base HTML ka baara kɛ ni popover dabɔli ye. Popover's Popover's
Kɛnɛma-datugulan-minɛn ka kan ka kɛ ni |
titiri | juru | baarakunda | '' '' . | Title nafa dafalen ni Ni baara dɔ dira, a bɛ Weele n'a ka |
ka ci | gaari | 'kliki' ye. | Popover bɛ daminɛ cogo min na - i ka | hover | sinsinnan | min bɛ fɛn bolo la. Aw bɛ se ka tɛmɛ fɛn caman fɛ minnu bɛ se ka kɛ sababu ye; u fara ɲɔgɔn kan ni yɔrɔ dɔ ye. manual tɛ se ka fara ɲɔgɔn kan ni fɛn wɛrɛ ye min bɛ se ka kɛ sababu ye. |
filɛlikɛyɔrɔ | juru | fɛn min bɛ kɛ | baarakunda | { sugandili: 'farikolo', padding: 0 } . | A bɛ popover mara o element in dancɛ kɔnɔ. Misali: Ni baara dɔ dira, a bɛ Weele ni 'fɛn min bɛ 'sèn Bɔ a la DOM node (dakun) min ye a ka dalilu kelen ye. A |
ka saniya kɛ | boolean ye | sɛbɛ | Saniyali in daminɛ walima k’a bali. Ni activated 'template' , 'content' ani 'title' sugandiliw bɛna saniya. |
whiteList ye | minɛn | Nafa min bɛ sɔrɔ a daminɛ na | Fɛn min bɛ ni fɛnw ni taamasiyɛnw ye minnu bɛ Sɔ̀rɔ |
sanitizeFn | null ka | baarakunda | fu | Yan aw bɛ se ka aw yɛrɛ ka sanitize baarakɛcogo di. O bɛ se ka kɛ nafa ye ni aw b’a fɛ ka baara kɛ ni gafemarayɔrɔ kɛrɛnkɛrɛnnen ye walasa ka saniya kɛ. |
Sugandili minnu bɛ kɛ popover kelen-kelenw na, olu bɛ se ka ɲɛfɔ cogo wɛrɛ la ni kunnafonidilanw ka fɛnw ye, i n’a fɔ a ɲɛfɔlen don cogo min na sanfɛ.
$().popover(options)
A bɛ popovers daminɛ ka ɲɛsin element collection dɔ ma.
.popover('show')
A bɛ element dɔ ka popover jira. A bɛ Segin welebaga ma sani popover ka jira tiɲɛ na (o kɔrɔ ye ko sanni ko shown.bs.popover
in ka Kɛ). O bɛ jate "manuel" triggering ye popover la. Popovers minnu tɔgɔ ni u kɔnɔkow bɛɛ ye zeru-janya ye, olu tɛ jira abada.
.popover('hide')
A bɛ element dɔ ka popover dogo. A bɛ Segin welebaga ma sani popover ka dogo tiɲɛ na (o kɔrɔ ye ko sanni ko hidden.bs.popover
in ka Kɛ). O bɛ jate "manuel" triggering ye popover la.
.popover('toggle')
A bɛ fɛn dɔ ka popover wuli. A bɛ Segin welebaga ma sani popover ka jira tiɲɛ na walima ka dogo (o kɔrɔ ye ko sanni shown.bs.popover
walima hidden.bs.popover
ko kɛlen ka Kɛ). O bɛ jate "manuel" triggering ye popover la.
.popover('destroy')
A bɛ element dɔ ka popover dogo ani k’a tiɲɛ. Popovers minnu bɛ baara Kɛ ni delegation ye (minnu bɛ Dabɔ ni option selector
ye ) tɛ Se ka Tiɲɛ kelen-kelen na descendant trigger elements kan.
Ko kɛlen suguya | Cogojirali |
---|---|
jira.bs.popover ye | O ko in bɛ tasuma Bɔ o yɔrɔnin bɛɛ ni show misali fɛɛrɛ Weelela. |
jirala.bs.popover | O ko in bɛ Bɔ ni popover Kɛra yelen ye baarakɛla fɛ (a bɛna CSS 'tɛmɛsiraw makɔnɔ u ka ban). |
dogo.bs.popover ye | O ko in bɛ Fɔ o yɔrɔnin bɛɛ ni hide misali fɛɛrɛ Weelera. |
dogolen.bs.faantanw | O ko in bɛ Bɔ ni popover ye dogolen Ban baarakɛla la (a bɛna CSS 'tɛmɛsiraw makɔnɔ u ka ban). |
donna.bs.faantanw | O ko in bɛ Bɔ kɛnɛ kan ko kɛlen kɔfɛ show.bs.popover ni popover template farala DOM kan. |
Aw bɛ dismiss baarakɛcogo fara lasɔmini cikanw bɛɛ kan ni nin plugin in ye.
Ni baara bɛ Kɛ ni .close
butɔni ye, a ka kan ka Kɛ den fɔlɔ ye .alert-dismissible
wa sɛbɛnni kɔnɔko si tɛ Se ka Nà a ɲɛfɛ taamasiyɛn na.
Aw bɛ nin ni nin fɛn caman Changer ani ka segin ka a lajɛ. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras mattis consectetur purus bɛ sigi amet fermentum la.
Dɔrɔn dɔ fara data-dismiss="alert"
i ka dadon butɔni kan walasa ka a yɛrɛma ka alert close functionality di. Ni i ye lasɔmini dɔ datugu, o b’a bɔ DOM kɔnɔ.
Walasa i ka lasɔminiw ka baara kɛ ni animation ye ni u bɛ dadon, i k’a lajɛ .fade
ni ani .in
kalanw bɛ u la kaban minnu bɛ tali kɛ u la.
$().alert()
A bɛ lasɔmini Kɛ ka 'kùnnafoni-cimago-ko kɛlenw Lamɛ bɔnsɔn fɛnw kan minnu bɛ ni data-dismiss="alert"
fɛnɲɛnɛma ye. (A man kan ni baara bɛ kɛ ni data-api ka auto-initialisation ye.)
$().alert('close')
A bɛ lasɔmini dɔ datugu ni a bɔli ye DOM kɔnɔ. Ni .fade
and .in
classes bɛ element kan, alert bɛ ban sani a ka bɔ.
Bootstrap ka lasɔmini-plugin bɛ ko damadɔw Bɔ kɛnɛ kan walasa ka jɛgɛn ka Kɛ lasɔmini baarakɛcogo la.
Ko kɛlen suguya | Cogojirali |
---|---|
close.bs.alert ye | O ko in bɛ tasuma Bɔ o yɔrɔnin bɛɛ ni close misali fɛɛrɛ Weelela. |
dadon.bs.alert ye | Nin ko in bɛ Fɔ ni lasɔmini Dafara (a bɛna CSS 'tɛmɛsiraw makɔnɔ u ka ban). |
Aw bɛ dɔ fara a kan ni butɔni ye. Kontrɔli butɔni bɛ fɔ walima ka butɔni kuluw Dabɔ yɔrɔ caman kama i n’a fɔ baarakɛminɛnw.
Firefox bɛ to senna foroko kɔrɔsili cogoyaw la (baarakɛbaliya ani sɛgɛsɛgɛli) ɲɛw doni bɛɛ kɔnɔ . o furakɛcogo dɔ ye ka baara kɛ ni a ye autocomplete="off"
. Aw ye Mozila buguri #654072 lajɛ .
Fàra o kan data-loading-text="Loading..."
walasa ka baara Kɛ ni doni cogoya ye butɔni dɔ kan.
O fɛɛrɛ in ma Kɛ fɔlɔ kabini v3.3.5 wa a Bɔra v4 kɔnɔ.
Nin jirali in kama, an bɛ baara kɛ ni data-loading-text
ani $().button('loading')
, nka o dɔrɔn tɛ jamana ye i bɛ se ka baara kɛ ni min ye. aw ye kunnafoni wɛrɛw lajɛ o kan jukɔrɔ $().button(string)
sɛbɛnw kɔnɔ .
A fara a kan data-toggle="button"
walasa ka toggling baara kɛ butɔni kelen kan.
.active
aniaria-pressed="true"
Ni butɔni minnu bɛ wuli ka kɔn, i ka kan ka .active
kalasi ni fɛn dɔ aria-pressed="true"
fara button
i yɛrɛ kan.
Aw bɛ fara jatebɔyɔrɔ data-toggle="buttons"
dɔ kan .btn-group
min kɔnɔ walima arajo dontaw bɛ yen walasa ka se ka fɛnw sɛgɛsɛgɛli kɛ u ka cogoyaw la.
.active
Walasa ka sugandiliw sugandi ka kɔn, i ka kan ka .active
kalansen fara donta kan label
i yɛrɛ ta kan.
Ni jatebɔ-kɛsu dɔ cogoya jatebɔlen bɛ kuraya k’a sɔrɔ click
ko kɛlen dɔ ma Fɔ butɔni kan (misali la , donna-sɛbɛnni nafa <input type="reset">
sigili fɛ walima a fɛ checked
), i bɛna a ɲini ka .active
kalansen in 'kɔnɔnafili label
i yɛrɛ kan.
$().button('toggle')
Toggles push jamana. A bɛ butɔni di i n’a fɔ a bɛ baara la.
$().button('reset')
A bɛ butɔni cogoya lasegin - a bɛ sɛbɛnniw falen-falen ka kɛ sɛbɛn fɔlɔ ye. O fɛɛrɛ in ye asynchrone ye wa a bɛ Segin ka Sɔrɔ resetting (labɛnni kura) ka Ban tiɲɛ na.
$().button(string)
A bɛ sɛbɛnniw ɲɔgɔn falen-falen ka kɛɲɛ ni sɛbɛnni cogoya o data ɲɛfɔlen ye.
Plugin flexible min bɛ baara Kɛ ni kalasi damadɔ ye walasa ka toggle kɛcogo nɔgɔn.
Collapse bɛ a ɲini transitions plugin ka don i ka Bootstrap version kɔnɔ.
Butɔn minnu bɛ duguma, olu digi walasa ka fɛn wɛrɛ jira ani k’a dogo kalanso caman yeli fɛ:
.collapse
kɔnɔkow bɛ dogo.collapsing
bɛ waleya fɛn caman tigɛli waatiw la.collapse.in
bɛ kɔnɔkow jiraAw bɛ se ka baara kɛ ni jɛgɛnsira ye ni o fɛn href
ye, walima ni butɔni ye min bɛ ni o fɛn data-target
ye. O ko fila bɛɛ la, a data-toggle="collapse"
wajibiyalen don.
A’ ye collapse behavior default janya walasa ka accordion dɔ dilan ni panneau component ye.
A fana bɛ se ka swap out .panel-body
s ni .list-group
s.
Aw ye aw jija ka dɔ fara aria-expanded
a kunbɛncogo kan. O jogo in bɛ fɛn min bɛ se ka da ɲɔgɔn kan, o cogoya ɲɛfɔ k’a jɛya ka ɲɛsin kalanbagaw ma ani o ɲɔgɔnna dɛmɛni fɛɛrɛw. Ni fɛn min bɛ se ka da ɲɔgɔn kan, o datugulen don ka kɛɲɛ ni a daminɛ ye, a ka kan ka kɛ ni nafa ye aria-expanded="false"
. N'i ye 'fɛn min bɛ Se ka Dabɔ, o Dabɔ ka Dabɔ ka Kɛɲɛ ni in
kalasi ye, i bɛ Segin aria-expanded="true"
'kɔnɔna na o nɔ na. Plugin bɛna o fɛn in sɛgɛsɛgɛ a yɛrɛma ka da a kan ni fɛn min bɛ se ka dabɔ, o dabɔra walima ni a datugulen tɛ.
Ka fara o kan, n’i ka kunnafoni-falen-falen-fɛn bɛ ka fɛn kelen Laɲini min bɛ Se ka Dabɔ – o kɔrɔ ye ko data-target
fɛnɲɛnɛma bɛ ka id
sugandilikɛla dɔ Jira – i bɛ Se ka fɛn wɛrɛ Fàra aria-controls
kunnafoni-falen-falen-fɛn kan, min kɔnɔ, fɛn min bɛ id
Se ka Dabɔ. Bi ɛkran kalanbagaw ni o ɲɔgɔnna dɛmɛnanw bɛ baara kɛ ni o fɛn in ye walasa ka sira surun wɛrɛw di baarakɛlaw ma walasa u ka se ka taa yɔrɔ la min bɛ se ka dabɔ a yɛrɛ la.
Collapse plugin bɛ baara Kɛ ni kala damadɔ ye walasa ka girinmanw kɔrɔtacogo ɲɛnabɔ:
.collapse
bɛ kɔnɔkow dogo.collapse.in
bɛ kɔnɔkow jira.collapsing
bɛ fara a kan ni tɛmɛsira daminɛna, ka bɔ ni a bannaO kalanw bɛ se ka sɔrɔ component-animations.less
.
Dɔrɔn ka fara data-toggle="collapse"
ani a data-target
kan element (fɛn) kan walasa ka automatiquement assign control de un collapsible element. Attribut data-target
bɛ sɔn CSS sugandili dɔ ma walasa ka collapse (dakun) in waleya. Aw ye aw jija ka kalasi fara fɛn dɔ kan min bɛ collapse
se ka wuli. N'i b'a fɛ a ka da wuli, i ka kalansen wɛrɛ fara a kan in
.
Walasa ka kulu ɲɛnabɔli min bɛ i n’a fɔ akordeyɔn, o fara kunnafoni-falen-falen-falen-falen-falen kan, i ka kunnafoni-falen-falen-falen-falen-falen-falen fara a kan data-parent="#selector"
. Aw ye demo lajɛ walasa ka nin ye wale la.
A bɛ se ka baara kɛ ni bolo ye ni:
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-parent=""
.
Tɔ̀gɔ | ka sɛbɛen masin na | fɔlɔ | cogojirali |
---|---|---|---|
bangebaga | sugandilikɛla | nkalon | Ni sugandili dɔ dira, o tuma na, fɛn minnu bɛ Se ka Dabɔ bangebaga kofɔlen jukɔrɔ, olu bɛɛ bɛ Dabɔ ni nin fɛn min bɛ Se ka Dabɔ, o jirala. (a bɛ tali kɛ laadala accordion kɛcogo la - o bɛ bɔ panel kalasi de la) |
toggle (toggle) kɛ | boolean ye | sɛbɛ | A bɛ fɛn min bɛ Se ka Dabɔ, o bɛ Yɛlɛma weleli kan |
.collapse(options)
A bɛ i ka kɔnɔkow baara i n’a fɔ fɛn min bɛ se ka da ɲɔgɔn kan. A bɛ sɔn sugandiliw ma minnu bɛ se ka kɛ object
.
.collapse('toggle')
A bɛ fɛn dɔ wuli ka bɔ a nɔ na ka taa jira walima ka dogo. A bɛ Segin welebaga ma sani fɛn min bɛ Se ka Dabɔ o ka Jira tiɲɛ na walima ka dogo (o kɔrɔ ye ko sanni shown.bs.collapse
walima hidden.bs.collapse
ko kɛlen ka Kɛ).
.collapse('show')
A bɛ fɛn dɔ jira min bɛ se ka wuli. A bɛ Segin welebaga ma sani fɛn min bɛ Se ka Dabɔ o ka Jira tiɲɛ na (o kɔrɔ ye ko sani ko shown.bs.collapse
in ka Kɛ).
.collapse('hide')
A bɛ fɛn dɔ dogo min bɛ Se ka Dabɔ. A bɛ Segin welebaga ma sani fɛn min bɛ Se ka Dabɔ o ka dogo tiɲɛ na (o kɔrɔ ye ko sani ko hidden.bs.collapse
in ka Kɛ).
Bootstrap ka collapse class bɛ ko damadɔw bɔ kɛnɛ kan ka ɲɛsin hooking into collapse functionality ma.
Ko kɛlen suguya | Cogojirali |
---|---|
jira.bs.ka bɔgɔbɔgɔ | O ko in bɛ tasuma Bɔ o yɔrɔnin bɛɛ ni show misali fɛɛrɛ Weelela. |
jiralen.bs.collapse ye | O ko in bɛ Fɔ ni fɛn dɔ Dònna 'kɔnɔ min bɛ Se ka Ye baarakɛla fɛ (a bɛna CSS 'tɛmɛsiraw makɔnɔ u ka ban). |
dogo.bs.dafalen | O ko in bɛ Fɔ o yɔrɔnin bɛɛ ni hide fɛɛrɛ in Weelela. |
dogolen.bs.collapse ye | O ko in bɛ Fɔ ni fɛn dɔ dogolen dòn baarakɛla la (a bɛna CSS 'tɛmɛsiraw makɔnɔ u ka ban). |
Slide jiracogo yɔrɔ dɔ min bɛ kɛ ka bisikili kɛ fɛnw fɛ, i n’a fɔ carousel. Nested carousels tɛ dɛmɛ sɔrɔ.
A ka c’a la, carousel yɔrɔ tɛ bɛn sɔrɔli sariyaw ma. N’i mago bɛ ka sariya labato, i ka fɛɛrɛ wɛrɛw lajɛ i ka kunnafoniw jiracogo la.
Bootstrap bɛ baara Kɛ ni CSS3 dɔrɔn ye a ka animation (ɲɛnamaya) la, nka Internet Explorer 8 & 9 tɛ CSS nafamafɛnw dɛmɛ minnu ka kan. O la, slide transition animations (slide transition animations) tɛ yen n’i bɛ baara Kɛ ni o navigatɛriw ye. An y’a latigɛ ni laɲini ye ko an kana jQuery-based fallbacks (fallbacks) Dòn a la 'tɛmɛsiraw kama.
Kalanso .active
ka kan ka fara slide dɔ kan. N’o tɛ, karɔsi tɛna ye.
A .glyphicon .glyphicon-chevron-left
ni .glyphicon .glyphicon-chevron-right
kalasiw tɛ wajibiya ka ɲɛsin kɔrɔsilikow ma. Bootstrap bɛ di .icon-prev
ani .icon-next
i n'a fɔ unicode gansan wɛrɛw.
aw bɛ sɛbɛnniw fara aw ka slayidiw kan nɔgɔya la ni .carousel-caption
fɛn ye min bɛ fɛn o fɛn kɔnɔ .item
. HTML sugandilen o fɛn bɛ Se ka Kɛ, o bɛɛ Blà yen k'a Labɛn a yɛrɛma ani k'a Labɛn.
Carousels bɛ baara kɛ ni an ye min id
bɛ kɛnɛma minɛn kan (the .carousel
) walasa carousel controls ka baara kɛ ka ɲɛ. Ni aw bɛ carousel caman fara a kan, walima ni aw bɛ carousel dɔ Changer id
, aw ye aw jija ka kunnafoni kuraw sɔrɔ minnu bɛ tali kɛ o ko la.
Baara kɛ ni data attributes ye walasa ka carousel jɔyɔrɔ kɔlɔsi nɔgɔya la. data-slide
bɛ sɔn daɲɛ kolomaw ma prev
walima next
, o min bɛ slide jɔyɔrɔ Changer ka kɛɲɛ n’a jɔyɔrɔ ye sisan. O cogo kelen na, baara kɛ ni data-slide-to
ka slide index raw tɛmɛ ka taa carousel data-slide-to="2"
, o bɛ slide jɔyɔrɔ wuli ka taa index kɛrɛnkɛrɛnnen dɔ la min bɛ daminɛ ni0
.
O data-ride="carousel"
jogo bɛ Kɛ ka carousel dɔ taamaʃyɛn Kɛ i n'a fɔ animation (ɲɛnamaya) k'a Daminɛ ɲɛ doni na. A tɛ se ka baara kɛ ni (redundant ani unnecessary) JavaScript daminɛcogo jɛlen ye carousel kelen na.
Aw bɛ carousel wele ni bolo ye ni:
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-interval=""
.
Tɔ̀gɔ | ka sɛbɛen masin na | fɔlɔ | cogojirali |
---|---|---|---|
cɛmancɛ | nimɔrɔ | 5000 ye | Waati hakɛ min ka kan ka bila kɔfɛ fɛn dɔ bolicogo otomatiki la. Ni nkalon don, carousel tɛna cycle kɛ a yɛrɛma. |
ka jɔ | juru | fu | "hover" ye. | ni a bilalen don "hover" , a bɛ karɔsi ka cycle jɔli jɔ ani ka carousel mouseenter ka cycle boli daminɛ kokura mouseleave . Ni a bilalen bɛ null , ka i yɛrɛ wuli karɔsi kan, o tɛna a jɔ. |
ka meleke | boolean ye | sɛbɛ | Ni carousel ka kan ka to ka cycle kɛ walima ka jɔyɔrɔ gɛlɛnw sɔrɔ. |
klaviyeti ye | boolean ye | sɛbɛ | Ni carousel ka kan ka jaabi di klaviyeti ko kɛlenw ma. |
.carousel(options)
A bɛ carousel daminɛ ni options options ye object
ani ka cycle daminɛ fɛnw fɛ.
.carousel('cycle')
A bɛ cycle kɛ carousel fɛnw kɔnɔ ka bɔ numan fɛ ka taa kinin fɛ.
.carousel('pause')
A bɛ carousel bali ka boli ka tɛmɛ fɛnw fɛ.
.carousel(number)
A bɛ carousel cycle kɛ ka taa frame kɛrɛnkɛrɛnnen dɔ la (0 basigilen, a bɛ tali kɛ array dɔ la).
.carousel('prev')
Sikiliw bɛ taa fɛn tɛmɛnen na.
.carousel('next')
Sikiliw bɛ taa fɛn nata la.
Bootstrap ka carousel kalan bɛ ko fila jira ka ɲɛsin hooking ka carousel baarakɛcogo ma.
O ko fla bɛɛ bɛ ni nin nafa wɛrɛw ye:
direction
: Karɔsi bɛ sɛgɛn sira min fɛ (o "left"
walima "right"
).relatedTarget
: DOM yɔrɔ min bɛ ka sɛgɛn ka don a nɔ na i n’a fɔ fɛn min bɛ baara kɛ.Karosel ko k��lenw bɛɛ bɛ Fɔ karɔsi yɛrɛ la (o kɔrɔ ye ko <div class="carousel">
).
Ko kɛlen suguya | Cogojirali |
---|---|
slide.bs.karosel | O ko in bɛ tasuma Bɔ o yɔrɔnin bɛɛ ni slide misali fɛɛrɛ in Weele. |
slid.bs.karɔsi ye | O ko in bɛ Fɔ ni karɔsili ye a ka slide transition (slide) tigɛli dafa. |
Affix plugin position: fixed;
bɛ wuli ka bɔ, ka nɔ min sɔrɔ ni position: sticky;
. Subnavigation min bɛ kinin fɛ, o ye affix plugin jiracogo ɲɛnama ye.
Baara kɛ ni affix plugin ye data attributes fɛ walima i yɛrɛ bolo ni i yɛrɛ ka JavaScript ye. O ko fila bɛɛ la, i ka kan ka CSS di i ka kɔnɔkow nɔrɔlenw jɔyɔrɔ n’u bonya kama.
Kɔlɔsili: Aw kana baara kɛ ni affix plugin ye fɛn dɔ kan min bɛ fɛn dɔ kɔnɔ min jɔyɔrɔ ka bon kosɛbɛ, i n’a fɔ koloma min bɛ sama walima min bɛ gɛlɛya, k’a sababu kɛ Safari jiracogo bug ye .
Affix plugin bɛ wuli ka bɔ kala saba cɛ, u kelen-kelen bɛɛ bɛ cogoya kɛrɛnkɛrɛnnen dɔ jira: .affix
, .affix-top
, ani .affix-bottom
. Aw ka kan ka cogoyaw di, fo ni position: fixed;
on ye.affix
, walasa o kàlan ninnu i yɛrɛ (min yɛrɛmahɔrɔnyalen don nin 'plugin in na) walasa ka jɔyɔrɔ yɛrɛyɛrɛw Labɛn.
Affix plugin bɛ baara kɛ cogo min na, o filɛ nin ye:
.affix-top
k’a Jira ko fɛn in bɛ a jɔyɔrɔ sanfɛla la. Nin waati in na, CSS jɔyɔrɔko si tɛ wajibiya..affix
falen .affix-top
ani ka sigi position: fixed;
(min bɛ di Bootstrap ka CSS fɛ)..affix
ni .affix-bottom
. Ikomi ofisiw ye ŋaniyataama ye, kelen sigili b’a ɲini i fɛ i ka CSS bɛnnen sigi. O cogo la, aw bɛ dɔ fara a kan position: absolute;
ni a mago bɛ a la. Plugin bɛ baara Kɛ ni data attribute walima JavaScript sugandilen ye walasa k’a Dɔn a bɛ Se ka fɛn in Blà yɔrɔ min na ka Bɔ yen.Aw bɛ sanfɛla fɛɛrɛw labato walasa k’aw ka CSS sigi baarakɛcogo sugandilenw dɔ la kelen na min bɛ duguma.
Walasa ka affix kɛcogo fara nɔgɔya la fɛn o fɛn kan, data-spy="affix"
i b’a fɛ ka fɛn min sɛgɛsɛgɛ dɔrɔn, i ka o fara a kan. Baara kɛ ni offsets ye walasa ka a ɲɛfɔ waati min na i ka kan ka fɛn dɔ pinɛ toggle.
Affix plugin wele JavaScript fɛ:
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-top="200"
.
Tɔ̀gɔ | ka sɛbɛen masin na | fɔlɔ | cogojirali |
---|---|---|---|
offset (fɔcogo ɲuman). | jate | baarakɛcogo | minɛn | 10 ye | Pixels ka offset ka bɔ ekran na ni jatebɔ jɔyɔrɔ scroll. Ni jateden kelen dira, offset bɛna kɛ sanfɛ ni duguma fan fila bɛɛ la. Walasa ka fɛn dɔ di min ɲɔgɔn tɛ, duguma ni sanfɛla bɛ fɛn dɔ di dɔrɔn offset: { top: 10 } walima offset: { top: 10, bottom: 5 } . Baara kɛ ni baarakɛcogo dɔ ye ni i mago bɛ ka jatebɔ kɛ ni fɛn dɔ ye min bɛ se ka kɛ sababu ye ka jatebɔ kɛ ni fɛn dɔ ye. |
kun | sugandilikɛla | node | jQuery yɔrɔ | window fɛn in |
A bɛ affix (daɲɛgafe) laɲinifɛn jira. |
.affix(options)
A bɛ i ka kɔnɔkow baara i n’a fɔ kɔnɔkow faralen ɲɔgɔn kan. A bɛ sɔn sugandiliw ma minnu bɛ se ka kɛ object
.
.affix('checkPosition')
A bɛ farankan cogoya jatebɔ kokura ka da fɛnw hakɛw, u jɔyɔrɔ ani u sɛrɛkili jɔyɔrɔ kan minnu bɛ tali kɛ o ko la. , .affix
, .affix-top
ani .affix-bottom
kalansenw bɛ Fàra walima ka Bɔ kɔnɔko nɔrɔlenw kan ka Kɛɲɛ ni cogoya kura ye. O fɛɛrɛ in ka kan ka wele tuma o tuma ni kɔnɔko nɔrɔlen hakɛw walima fɛn laɲininen hakɛw b’a la ka Changé, walasa ka kɔnɔko nɔrɔlenw jɔyɔrɔ ɲuman sɔrɔ.
Bootstrap ka affix plugin bɛ ko damadɔw Bɔ kɛnɛ kan ka ɲɛsin affix baarakɛcogo ma.
Ko kɛlen suguya | Cogojirali |
---|---|
farankan.bs.affix | O ko in bɛ tasuma Bɔ o yɔrɔnin bɛɛ sanni element in ka nɔrɔ. |
farankan.bs.affix | O ko in bɛ Fɔ ni element (fɛn) in nɔrɔlen kɔ. |
farankan-sanfɛ.bs.affix | O ko in bɛ tasuma Bɔ o yɔrɔnin bɛɛ sanni element ka nɔrɔ-sanfɛ. |
farankan-sanfɛ.bs.affix | O ko in bɛ Fɔ ka Bɔ element (fɛn) in kɛlen kɔ ka affixed-top (sanfɛ) Kɛ. |
affix-jukɔrɔ.bs.affix | O ko in bɛ tasuma Bɔ o yɔrɔnin bɛɛ sanni element ka nɔrɔ-jukɔrɔ. |
affixed-bottom.bs.affix ye min bɛ wele ko affix | O ko in bɛ Fɔ ni fɛn in ye affixed-bottom kɔfɛ. |