Etsa hore likarolo tsa Bootstrap li phele—hona joale ka li- plugins tse 12 tsa jQuery .
Sesebelisoa se nolofalitsoeng, empa se feto-fetoha, se nka plugin ea setso ea javascript e nang le ts'ebetso e fokolang feela e hlokahalang le mefokolo e bohlale.
Kenya li-menu tse theohang hoo e batlang e le eng kapa eng e Bootstrap ka plugin ena e bonolo. Bootstrap e na le ts'ehetso e felletseng ea li-menu tse theohang ho navbar, li-tab le lipilisi.
Sebelisa scrollspy ho ntlafatsa lihokelo tse ho navbar ea hau ka bo eona ho bonts'a sehokelo sa hajoale se sebetsang se ipapisitseng le boemo ba moqolo.
Sebelisa plugin ena ho etsa hore li-tabo le lipilisi li be le thuso haholoanyane ka ho li lumella hore li fete ka har'a liphasejene tse fumanehang tsa litaba tsa lehae.
Mokhoa o mocha oa plugin ea jQuery Tipsy, Litlhahiso ha li itšetlehe ka litšoantšo-li sebelisa CSS3 bakeng sa lipopae le litšobotsi tsa data bakeng sa polokelo ea lihlooho tsa lehae.
Eketsa likoahelo tse nyane tsa litaba, joalo ka tse ho iPad, ho karolo efe kapa efe bakeng sa tlhaiso-leseling ea bobeli ea matlo.
* E hloka hore lithulusi li kenyeletsoe
Plugin ea tlhokomeliso ke sehlopha se senyane sa ho eketsa ts'ebetso e haufi le litlhokomeliso.
Etsa ho eketsehileng ka likonopo. Konopo ea ho laola e bolela kapa etsa lihlopha tsa likonopo bakeng sa likarolo tse ling tse kang lithulusi.
Fumana mekhoa ea motheo le tšehetso e feto-fetohang bakeng sa likarolo tse putlamang joalo ka li-accordion le navigation.
Etsa papali e monate ea litaba life kapa life tseo u lakatsang ho fana ka pontšo ea li-slideshow tsa litaba.
Plugin ea mantlha, e atolositsoeng habonolo bakeng sa ho theha kapele li-typeheads tse ntle ka mokhoa ofe kapa ofe oa mongolo.
Bakeng sa liphetho tse bonolo tsa phetoho, kenyelletsa bootstrap-transition.js hang ho thella ka mokhoa o itseng kapa tlhokomeliso e nyamele.
* E ea hlokahala bakeng sa animation ho li-plugins
Sesebelisoa se nolofalitsoeng, empa se feto-fetoha, se nka plugin ea setso ea javascript e nang le ts'ebetso e fokolang feela e hlokahalang le mefokolo e bohlale.
Khoasolla faeleKa tlase ho na le modal e entsoeng ka statically.
'Mele o le mong o motle ...
Fetolela modal ka javascript ka ho tobetsa konopo e ka tlase. E tla thellela fatše ebe e nyamela ho tloha holimo leqepheng.
Qala mokhoa oa demoLetsetsa modal ka javascript:
- $ ( '#MyModal' ). modal ( likhetho )
Lebitso | mofuta | ya kamehla | tlhaloso |
---|---|---|---|
bokamorao | boolean | 'nete | E kenyelletsa karolo ea modal-backdrop. Ntle le moo, hlakisa static boemo ba morao-rao bo sa koaheleng mokhoa oa ho tobetsa. |
keyboard | boolean | 'nete | E koala modal ha konopo ea escape e tobetsoa |
bontsha | boolean | 'nete | E bonts'a modal ha e qala. |
U ka kenya li-modals leqepheng la hau habonolo ntle le ho ngola mola o le mong oa javascript. Beha feela data-toggle="modal"
ntho ea taolo e nang le data-target="#foo"
kapa href="#foo"
e tsamaellanang le id ea modal element, 'me ha e tobetse, e tla tsebisa modal ea hau.
Hape, ho kenyelletsa likhetho molemong oa hau oa modal, li kenyelle feela e le lintlha tse ling tsa data ho karolo ea taolo kapa modal markup ka boeona.
- <a class = "btn" data-toggle = "modal" href = "#myModal"> Mokhoa oa ho qala </a>
- <div class = "modal hide" id = "myModal" >
- <div class = "modal-header" >
- < mofuta oa konopo = "button" class = "close" data-dismiss = "modal" > × </button>
- <h3> Sehlooho sa Modal </h3>
- </ div>
- <div class = "modal-body" >
- <p> 'Mele o le mong o motle… </p>
- </ div>
- <div class = "modal-footer" >
- <a href = "#" class = "btn" data-dismiss = "modal"> Koala </a> _
- <a href = "#" class = "btn btn-primary"> Boloka liphetoho </a>
- </ div>
- </ div>
.fade
sehlopha ho
.modal
element (sheba demo ho bona sena se sebetsa) 'me u kenyelle bootstrap-transition.js.
E kenya tšebetsong litaba tsa hau joalo ka mokhoa. E amohela khetho ea boikhethelo object
.
- $ ( '#MyModal' ). mokhoa ({
- keyboard : bohata
- })
E fetola modal ka letsoho.
- $ ( '#MyModal' ). modal ( 'toggle' )
E bula modal ka letsoho.
- $ ( '#MyModal' ). modal ( 'show' )
E pata modal ka letsoho.
- $ ( '#MyModal' ). modal ( 'hide' )
Sehlopha sa modal sa Bootstrap se pepesa liketsahalo tse 'maloa tsa ho hokahana le ts'ebetso ea modal.
Ketsahalo | Tlhaloso |
---|---|
bontsha | Ketsahalo ena e tuka hang hang ha show mokhoa oa mohlala o bitsoa. |
bontshitswe | Ketsahalo ena e ts'oaroa ha modal e entsoe hore e bonahale ho mosebelisi (e tla emela hore liphetoho tsa css li phethehe). |
pata | Ketsahalo ena e lelekoa hang hang ha hide mokhoa oa mohlala o bitsoa. |
patiloeng | Ketsahalo ena e ts'oaroa ha modal e qeta ho patoa ho mosebelisi (e tla emela hore liphetoho tsa css li phethehe). |
- $ ( '#MyModal' ). ho ( 'e patiloeng' , mosebetsi () {
- // etsa ntho e itseng...
- })
Kenya li-menu tse theohang hoo e batlang e le eng kapa eng e Bootstrap ka plugin ena e bonolo. Bootstrap e na le ts'ehetso e felletseng ea li-menu tse theohang ho navbar, li-tab le lipilisi.
Khoasolla faeleTobetsa ho lihokelo tsa nav tse ka tlase ho navbar le lipilisi tse ka tlase ho leka ho theoha.
Letsetsa li-dropdown ka javascript:
- $ ( '. dropdown-toggle' ). ho theoha ()
Ho eketsa ts'ebetso ea ho theoha ka potlako nthong efe kapa efe, eketsa feela data-toggle="dropdown"
'me ho theoha hofe kapa hofe ho nepahetseng ha bootstrap ho tla kengoa tšebetsong.
data-target="#fat"
kapa
href="#fat"
.
- <ul class = "nav nav-pills" >
- <li class = "active" ><a href = "#"> Sehokelo sa kamehla </a></li >
- <li class = "dropdown" id = "menu1" >
- <a class = "dropdown-toggle" data-toggle = "dropdown" href = "#menu1"> _
- Theosa
- <b sehlopha = "tlhokomelo" ></b>
- </a>
- <ul class = "dropdown-menu" >
- <li><a href = "#"> Ketso </a> </li>
- <li><a href = "#"> Ketso e nngwe </a></li>
- <li><a href = "#"> Ho hong hape mona </a></li>
- <li class = "divider" > </li>
- <li><a href = "#"> Sehokelo se arohaneng </a></li>
- </ul>
- </li>
- ...
- </ul>
Ho boloka li-URL li sa fetohe, sebelisa data-target
tšobotsi ho e-na le href="#"
.
- <ul class = "nav nav-pills" >
- <li class = "dropdown" >
- <a class = "dropdown-toggle" data-toggle = "dropdown" data-target = "#" href = "path/to/page.html"> _
- Theosa
- <b sehlopha = "tlhokomelo" ></b>
- </a>
- <ul class = "dropdown-menu" >
- ...
- </ul>
- </li>
- </ul>
Lenaneo la api bakeng sa ho kenya dimenu bakeng sa navbar kapa navigation e nang le dithebe.
The ScrollSpy plugin ke ea ho inchafatsa lipheo tsa nav ka bo eona ho ipapisitse le boemo ba moqolo.
Khoasolla faeleTsamaisetsa sebaka se ka tlase 'me u shebelle ntlafatso ea ho tsamaea. Lintlha tse tlase li tla totobatsoa hape. E leke!
Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi pele ba rekisa qui. Litokelo tsa libaesekele tsa polasi-to-tafola tsa Tumblr eng kapa eng. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui mohlomong ha u e-s'o utloe ka tsona et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.
Veniam marfa mustache skateboard, adipisicing fugiat velit pitchfork litelu. Litelu tsa Freegan aliqua cupidatat mcsweeney's vero. Cupidatat tse nne loko nisi, ea helvetica nulla carles. Lori ea lijo e nang le tattoo ea cosby sweater, mcsweeney's quis non freegan vinyl. Lo-fi wes anderson +1 sartorial. Carles non aesthetic exercitation quis gentrify. Brooklyn adipisicing craft biri motlatsi oa keytar deserunt.
Occaecat commodo aliqua deelectus. Fap craft beer deserunt skateboard ea. Lomo bicycle rights adipisicing banh mi, velit ea sunt next level locavore single-origin coffee in magna veniam. High life id vinyl, echo park consequat quis aliquip banh mi pitchfork. Vero VHS e ntlafalitse. Consectetur nisi DIY minim messenger bag. Cred ex in, sustainable delectus consectetur fanny pack iphone.
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 messenger bag marfa whatever delectus food truck. Sapiente synth id guessnda. Locavore sed helvetica cliche irony, thundercats mohlomong ha u so utloe ka tsona consequat hoodie gluten-free lo-fi fap aliquip. Labore elit placeat pele ba rekisa, terry richardson proident brunch nesciunt quis cosby sweater pariatur keffiyeh ut helvetica artisan. Cardigan craft biri seitan readymade velit. VHS chambray laboris tempor veniam. Anim mollit minim commodo ullamco thundercats.
Letsetsa scrollspy ka javascript:
- $ ( '#navbar' ). scrollspy ()
Ho eketsa habonolo boits'oaro ba scrollspy ho navigation ea hau ea topbar, kenya feela nthong data-spy="scroll"
eo u batlang ho e hloela (haholo e tla ba 'mele).
- <body data-spy = "scroll" > ... </body>
<a href="#home">home</a>
tlameha ho lumellana le ntho e ka dom e kang
<div id="home"></div>
.
Ha o sebelisa scrollspy mmoho le ho eketsa kapa ho tlosa likarolo ho tsoa ho DOM, o tla hloka ho letsetsa mokhoa oa ho khatholla joalo ka:
- $ ( '[data-spy="scroll"]' ). e 'ngoe le e' ngoe ( mosebetsi () {
- var $ hloela = $ ( sena ). scrollspy ( 'refresh' )
- });
Lebitso | mofuta | ya kamehla | tlhaloso |
---|---|---|---|
offset | palo | 10 | Lipikseli tsa ho theola ho tloha holimo ha ho baloa boemo ba ho tsamaisa. |
Ketsahalo | Tlhaloso |
---|---|
kenya tshebetsong | Ketsahalo ena e tuka neng kapa neng ha ntho e ncha e kentsoe tšebetsong ke scrollspy. |
Plugin ena e eketsa ts'ebetso ea tabo e potlakileng, e matla le lipilisi bakeng sa ho fetela ka har'a litaba tsa lehae.
Khoasolla faeleTobetsa li-tab tse ka tlase ho fetola lipakeng tsa li-panels tse patiloeng, esita le ka li-menu tse theohang.
Raw denim mohlomong ha u e-s'o utloe ka bona li-jean shorts Austin. Nesciunt tofu stumptown aliqua, retro synth master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh dreamcatcher synth. Cosby sweater eu banh mi, qui irure terry richardson ex squid. Aliquip placeat salvia cillum iphone. Seitan aliquip quis cardigan american apparel, butcher 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 locavore wolf cliche high life echo park Austin. Cred vinyl keffiyeh DIY salvia PBR, banh mi pele ba rekisa polasi-to-tafoleng VHS viral locavore cosby sweater. Lomo wolf viral, mustache readymade thundercats keffiyeh craft beer marfa ethical. Wolf salvia freegan, sartorial keffiyeh echo park vegan.
Lumella li-tabbable ka javascript (tabo e 'ngoe le e' ngoe e hloka ho etsoa ka bonngoe):
- $ ( '#myTab a' ). tobetsa ( mosebetsi ( e ) {
- e . preventDefault ();
- $ ( sena ). tab ( 'show' );
- })
O ka kenya li-tab tsa motho ka mong ka litsela tse 'maloa:
- $ ( '#MyTab a[href="#profile"]' ). tab ( 'show' ); // Khetha tab ka mabitso
- $ ( '#myTab a:first' ). tab ( 'show' ); // Khetha tab ya pele
- $ ( '#myTab a:last' ). tab ( 'show' ); // Khetha tab ya ho qetela
- $ ( '#myTab li:eq(2) a' ). tab ( 'show' ); // Khetha tabo ea boraro (0-indexed)
O ka kenya ts'ebetso ea "tabo" kapa "pilisi" ntle le ho ngola javascript leha e le efe ka ho hlakisa feela data-toggle="tab"
kapa data-toggle="pill"
ka ntho e itseng. Ho kenyelletsa nav
le nav-tabs
litlelase ho tab ho ul
tla sebelisa setaele sa "bootstrap tab".
- <ul class = "nav-tabs" >
- <li><a href = "#home" data-toggle = "tab"> Lehae </a></li >
- <li><a href = "#profile" data-toggle = "tab"> Boemo </a> </li>
- <li><a href = "#messages" data-toggle = "tab"> Melaetsa </a></li >
- <li><a href = "#settings" data-toggle = "tab"> Litlhophiso </a></li >
- </ul>
E kenya tshebetsong karolo ya tab le setshelo sa dikahare. Tab e lokela ho ba le node ea setshelo data-target
kapa e href
lebisitsoeng ho DOM.
- <ul class = "nav-tabs" id = "myTab" >
- <li class = "active" ><a href = "#home"> Lehae </a></li >
- <li><a href = "#profile"> Profile </a> </li>
- <li><a href = "#melaetsa"> Melaetsa </a> </li>
- <li><a href = "#settings"> Litlhophiso </a> </li>
- </ul>
- <div class = "tab-content" >
- <div class = "tab-pane e sebetsang" id = "hae" > ... </div>
- <div class = "tab-pane" id = "profile" > ... </div>
- <div class = "tab-pane" id = "melaetsa" > ... </div>
- <div class = "tab-pane" id = "settings" > ... </div>
- </ div>
- <script>
- $ ( mosebetsi () {
- $ ( '#myTab a:last' ). tab ( 'show' );
- })
- </script>
Ketsahalo | Tlhaloso |
---|---|
bontsha | Ketsahalo ena e qala ho bonts'a li-tab, empa pele tab e ncha e bontšoa. Sebelisa event.target le event.relatedTarget ho shebisa tab e sebetsang le tab e fetileng e sebetsang (haeba e le teng) ka ho latellana. |
bontshitswe | Ketsahalo ena e tla hlaha ka mor'a hore tab e hlahisoe. Sebelisa event.target le event.relatedTarget ho shebisa tab e sebetsang le tab e fetileng e sebetsang (haeba e le teng) ka ho latellana. |
- $ ( 'a[data-toggle="tab"]' ). ho ( 'e bontšitsoeng' , mosebetsi ( e ) {
- e . target // Letlapa le butsoeng
- e . amanangTarget // tab e fetileng
- })
E bululetsoe ke plugin e ntle haholo ea jQuery.tipsy e ngotsoeng ke Jason Frame; Litlhahiso ke mofuta o ntlafalitsoeng, o sa itšetleheng ka litšoantšo, sebelisa Css3 bakeng sa lipopae, le litšobotsi tsa data bakeng sa polokelo ea lihlooho tsa lehae.
Khoasolla faeleTsamaea holim'a lihokelo tse ka tlase ho bona lintlha tsa lisebelisoa:
Borikhoe bo thata bo latelang keffiyeh mohlomong ha u so utloe ka bona. Photo booth litelu tse tala tsa denim letterpress vegan messenger bag stumptown. Seaparo sa polasi-to-tafola seitan, mcsweeney's fixie sustainable quinoa 8-bit american apparse e na le terry richardson vinyl chambray. Litelu stumptown, cardigans banh mi lomo thundercats. Tofu biodiesel williamsburg marfa, four loko mcsweeney's cleanse vegan chambray. A really ironic artisan whatever keytar , scenester farm-to-table banksy Austin twitter handle freegan cred raw denim single-origin coffee viral.
Qala sesebelisoa ka javascript:
- $ ( '#mohlala' ). tooltip ( likgetho )
Lebitso | mofuta | ya kamehla | tlhaloso |
---|---|---|---|
animation | boolean | 'nete | sebelisa phetoho ea css fade ho tooltip |
ho beha | khoele|mosebetsi | 'holimo' | mokhoa oa ho beha tooltip - top | tlase | le letšehali | hantle |
mokhethi | khoele | bohata | Haeba ho fanoe ka sekhetho, lintlha tsa lisebelisoa li tla abeloa lipehelo tse boletsoeng. |
sehlooho | khoele | tshebetso | '' | boleng ba sehlooho sa kamehla haeba tag ea `sehlooho` e le sieo |
qhoqhoa | khoele | 'hover' | kamoo tooltip e hlahisoang kateng - hover | tsepamisa | tataiso |
lieha | nomoro | ntho | 0 | tieho ho bonts'a le ho pata ntlha ea lisebelisoa (ms) - ha e sebetse mofuteng oa ho qala ka letsoho Haeba nomoro e fanoe, ho lieha ho sebelisoa ho pata/show ka bobeli Sebopeho sa ntho ke: |
Bakeng sa mabaka a ts'ebetso, Tooltip le Popover data-apis li khetha ho kena. Haeba u batla ho li sebelisa, bolela feela khetho ea khetho.
- <a href = "#" rel = "tooltip" title = "tooltip ea pele"> okamela holim'a ka </a>
E hokela sebatli sa lithulusi pokellong ea lintho.
E senola karolo ea lisebelisoa.
- $ ( '#element' ). tooltip ( 'show' )
E pata ntlha ea lisebelisoa.
- $ ( '#element' ). tooltip ( 'hide' )
E fetola ntlha ea lisebelisoa.
- $ ( '#element' ). tooltip ( 'toggle' )
Eketsa likoahelo tse nyane tsa litaba, joalo ka tse ho iPad, ho karolo efe kapa efe bakeng sa tlhaiso-leseling ea bobeli ea matlo.
* E hloka hore Tooltip e kenyeletsoe
Khoasolla faeleTsamaisa holim'a konopo ho qala popover.
Lumella li-popover ka javascript:
- $ ( '#mohlala' ). popover ( likhetho )
Lebitso | mofuta | ya kamehla | tlhaloso |
---|---|---|---|
animation | boolean | 'nete | sebelisa phetoho ea css fade ho tooltip |
ho beha | khoele|mosebetsi | 'ho lokile' | mokhoa oa ho beha popover - holimo | tlase | le letšehali | hantle |
mokhethi | khoele | bohata | haeba ho fanoe ka khetho, lisebelisoa tsa lisebelisoa li tla abeloa lipehelo tse boletsoeng |
qhoqhoa | khoele | 'hover' | kamoo tooltip e hlahisoang kateng - hover | tsepamisa | tataiso |
sehlooho | khoele | tshebetso | '' | boleng ba sehlooho sa kamehla ha semelo sa `sehlooho` se le sieo |
dikahare | khoele | tshebetso | '' | boleng ba dikahare tsa kamehla haeba semelo sa `seteng sa data` se le sieo |
lieha | nomoro | ntho | 0 | tieho ho bonts'a le ho pata popover (ms) - ha e sebetse ho mofuta oa mochini oa ho qala Haeba nomoro e fanoe, ho lieha ho sebelisoa ho pata/show ka bobeli Sebopeho sa ntho ke: |
Bakeng sa mabaka a ts'ebetso, Tooltip le Popover data-apis li khetha ho kena. Haeba u batla ho li sebelisa, bolela feela khetho ea khetho.
E qala popovers bakeng sa pokello ea lintho.
E senola sebopeho sa element.
- $ ( '#element' ). popover ( 'show' )
E pata li-element popover.
- $ ( '#element' ). popover ( 'hide' )
E fetola popo ea lintho.
- $ ( '#element' ). popover ( 'toggle' )
Plugin ea tlhokomeliso ke sehlopha se senyane sa ho eketsa ts'ebetso e haufi le litlhokomeliso.
KhoasollaPlugin ea litlhokomeliso e sebetsa melaetsa ea kamehla ea tlhokomeliso, le ho thibela melaetsa.
Fetola sena le sane ebe o leka hape. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras mattis consectetur purus sit amet fermentum.
Lumella ho tlosoa ha tlhokomeliso ka javascript:
- $ ( ".alert" ). hlokomelisa ()
Kenya feela data-dismiss="alert"
konopo ea hau ea ho koala ho fana ka ts'ebetso e haufi ea tlhokomeliso.
- <a class = "close" data-dismiss = "alert" href = "#" > × </a>
E phuthela litlhokomeliso tsohle ka ts'ebetso e haufi. Ho etsa hore litemoso tsa hau li phele ha u koetsoe, etsa bonnete ba hore li se li ntse li sebelisoa .fade
le sehlopha..in
E koala tlhokomeliso.
- $ ( ".alert" ). tlhokomeliso ( 'close' )
Sehlopha sa tlhokomeliso sa Bootstrap se pepesa liketsahalo tse 'maloa bakeng sa ho hokahana le ts'ebetso ea tlhokomeliso.
Ketsahalo | Tlhaloso |
---|---|
koala | Ketsahalo ena e tuka hang hang ha close mokhoa oa mohlala o bitsoa. |
koaloa | Ketsahalo ena e etsoa ha tlhokomeliso e koetsoe (e tla emela hore liphetoho tsa css li phethehe). |
- $ ( '#temoso eaka' ). tlama ( 'koetsoe' , mosebetsi () {
- // etsa ntho e itseng...
- })
Fumana mekhoa ea motheo le tšehetso e feto-fetohang bakeng sa likarolo tse putlamang joalo ka li-accordion le navigation.
Khoasolla faele* E hloka hore plugin ea Transitions e kenyeletsoe.
Re sebelisa plugin ea ho putlama, re thehile widget e bonolo ea setaele sa accordion:
Dumella ka javascript:
- $ ( ".collapse" ). putlama ()
Lebitso | mofuta | ya kamehla | tlhaloso |
---|---|---|---|
motsoadi | mokhethi | bohata | Haeba sekhethi se tla koaleha, likarolo tsohle tse ka putlamang tlas'a motsoali ea boletsoeng li tla koaloa ha ntho ena e bonohang e bontšoa. (e ts'oanang le boitšoaro ba moetlo oa accordion) |
toggle | boolean | 'nete | E fetola ntho e ka putlamang kopong |
Kenya feela data-toggle="collapse"
le data-target
ho element ho abela taolo ea ntho e putlahang. Tšobotsi e amohela khetho ea data-target
css eo u ka sebelisang ho putlama ho eona. Etsa bonnete ba hore o kenyelletsa sehlopha collapse
ho ntho e putlang. Haeba u rata hore e bulehe ka mokhoa o tloaelehileng, eketsa sehlopha sa tlatsetso in
.
- <button class = "btn btn-danger" data-toggle = "collapse" data-target = "#demo" >
- e phuthoang e bonolo
- </ konopo>
- <div id = "demo" class = "collapse in" > … </div>
data-parent="#selector"
. Sheba demo ho bona sena se sebetsa.
E kenya tšebetsong litaba tsa hau joalo ka ntho e ka putlamang. E amohela khetho ea boikhethelo object
.
- $ ( '#myCollapsible' ). ho putlama ({
- toggle : bohata
- })
E fetolela ntho e putlahang hore e bontšoe kapa e patiloe.
E bonts'a ntho e putlahang.
E pata ntho e putlang.
Sehlopha sa ho putlama sa Bootstrap se pepesa liketsahalo tse 'maloa bakeng sa ho hokahana le ts'ebetso ea ho putlama.
Ketsahalo | Tlhaloso |
---|---|
bontsha | Ketsahalo ena e tuka hang hang ha show mokhoa oa mohlala o bitsoa. |
bontshitswe | Ketsahalo ena e ts'oaroa ha karolo e putlamang e bonahalitsoe ho mosebelisi (e tla emela hore liphetoho tsa css li phethehe). |
pata | Ketsahalo ena e lelekoa hang-hang ha hide mokhoa o bitsoa. |
patiloeng | Ketsahalo ena e ts'oaroa ha karolo ea ho putlama e patetsoe mosebelisi (e tla emela hore liphetoho tsa css li phethehe). |
- $ ( '#myCollapsible' ). ho ( 'e patiloeng' , mosebetsi () {
- // etsa ntho e itseng...
- })
Shebella slideshow ka tlase.
Letsa ka javascript:
- $ ( '.carousel' ). carousel ()
Lebitso | mofuta | ya kamehla | tlhaloso |
---|---|---|---|
karohano | palo | 5000 | Nako ea ho lieha pakeng tsa ho palama ntho ka bo eona. Haeba e le leshano, carousel e ke ke ea potoloha ka bo eona. |
kgefutsa | khoele | "tsamaea" | E emisa ho palama baesekele ho mouseenter mme e qalella ho palama baesekele ea carousel holim'a mouseleave. |
Litšobotsi tsa data li sebelisoa bakeng sa litataiso tse fetileng le tse latelang. Sheba mohlala o ka tlase.
- <div id = "myCarousel" sehlopha = "carousel slide" >
- <!-- Lintho tsa Carousel -->
- <div sehlopha = "carousel-inner" >
- <div class = "ntho e sebetsang" > ... </div>
- <div class = "ntho" > ... </div>
- <div class = "ntho" > ... </div>
- </ div>
- <!-- Carousel nav -->
- <a class = "carousel-control left" href = "#myCarousel" data-slide = "prev"> & lsaquo ; </a>
- <a class = "carousel-control right" href = "#myCarousel" data-slide = "e latelang" > › </a>
- </ div>
E qala carousel ka khetho ea boikhethelo object
ebe e qala ho palama lintho.
- $ ( '.carousel' ). carousel ({
- nako : 2000
- })
E potoloha ka har'a lintho tsa carousel ho tloha ho le letšehali ho ea ho le letona.
E emisa carousel ho palama baesekele ka har'a lintho.
E potoloha carousel ho foreime e itseng (0 e thehiloeng, e ts'oanang le lethathamo).
Lipotoloho ho ea nthong e fetileng.
Lipotoloho ho ea nthong e latelang.
Sehlopha sa carousel sa Bootstrap se pepesa liketsahalo tse peli tsa ho hokahana le ts'ebetso ea carousel.
Ketsahalo | Tlhaloso |
---|---|
thella | Ketsahalo ena e tuka hang hang ha slide mokhoa oa mohlala o sebelisoa. |
thella | Ketsahalo ena e thunngoa ha carousel e phethela phetoho ea eona ea li-slide. |
Plugin ea mantlha, e atolositsoeng habonolo bakeng sa ho theha kapele li-typeheads tse ntle ka mokhoa ofe kapa ofe oa mongolo.
Khoasolla faeleQala ho thaepa lebaleng le ka tlase ho bontša liphetho tsa sehlooho.
Letsetsa motlalehi ka javascript:
- $ ( '.typeahead' ). mofuta oa pele ()
Lebitso | mofuta | ya kamehla | tlhaloso |
---|---|---|---|
mohlodi | array | [ ] | Mohloli oa data oa ho botsa khahlano le. |
lintho | palo | 8 | Nomoro e phahameng haholo ea lintho tse tla hlahisoa ho dropdown. |
matcher | tshebetso | ho hloka kutlo | Mokhoa o sebelisoang ho fumana hore na potso e lumellana le ntho e itseng. E amohela khang e le 'ngoe, item eo ho eona ho lekang potso. Fumana seo u se batlang ka this.query . Khutlisetsa boolean true haeba potso e lumellana. |
hlopha | tshebetso | ntho e nyallanang hantle, e nyenyefatsang taba, ha e na kutlo |
Mokhoa o sebelisitsoeng ho hlophisa liphetho tsa ho qetela. E amohela khang e le 'ngoe' items me e na le boholo ba mohlala oa typeahead. Sheba potso ea hajoale ka this.query . |
e totobatsang | tshebetso | e totobatsa litšoaneleho tsohle tsa kamehla | Mokhoa o sebelisitsoeng ho totobatsa liphetho tsa ho qetela. E amohela khang e le 'ngoe' item me e na le boholo ba mohlala oa typeahead. E lokela ho khutlisa html. |
Kenya litšobotsi tsa data ho ngolisa ntho e nang le ts'ebetso ea typeahead.
- <input type = "text" data- provide = "typeahead" >
E qala ho kenya letsoho ka ho ngola pele.