Nqa Bootstrap cov khoom rau lub neej-tam sim no nrog 12 kev cai jQuery plugins.
Ib tug streamlined, tab sis saj zawg zog, coj nyob rau hauv ib txwm javascript modal plugin nrog tsuas yog qhov tsawg kawg nkaus yuav tsum functionality thiab ntse defaults.
Ntxiv dropdown menus rau yuav luag txhua yam hauv Bootstrap nrog qhov yooj yim plugin no. Bootstrap nta tag nrho dropdown zaub mov txhawb nyob rau hauv lub navbar, tabs, thiab tshuaj.
Siv scrollspy los hloov kho cov kev txuas hauv koj lub navbar los qhia qhov txuas tam sim no raws li txoj haujlwm scroll.
Siv cov plugin no los ua cov tabs thiab cov ntsiav tshuaj muaj txiaj ntsig zoo los ntawm kev tso cai rau lawv hloov mus los ntawm cov kab ntawv tabbable ntawm cov ntsiab lus hauv zos.
Ib qho tshiab coj los ntawm jQuery Tipsy plugin, Tooltips tsis cia siab rau cov duab-lawv siv CSS3 rau cov animations thiab cov ntaub ntawv-tus cwj pwm rau cov npe hauv zos.
Ntxiv me me ntawm cov ntsiab lus, zoo li cov hauv iPad, rau txhua lub hauv paus rau cov ntaub ntawv thib ob hauv tsev.
* Yuav tsum muaj cov lus qhia kom suav nrog
Lub ceeb toom plugin yog chav kawm me me ntxiv rau kev ua haujlwm ze rau kev ceeb toom.
Ua ntau nrog cov nyees khawm. Tswj khawm hais los yog tsim pab pawg ntawm cov nyees khawm rau ntau yam xws li toolbars.
Tau txais cov qauv tsim thiab hloov pauv hloov pauv rau cov khoom sib tsoo zoo li accordions thiab navigation.
Tsim kom muaj kev lom zem-mus-ncig ntawm cov ntsiab lus koj xav muab kev sib tham sib slideshow ntawm cov ntsiab lus.
Ib qho yooj yim, yooj yim txuas ntxiv plugin rau sai sai tsim elegant typeaheads nrog rau cov ntawv sau ntawv nkag.
Rau kev hloov pauv yooj yim, suav nrog bootstrap-transition.js ib zaug kom xaub hauv cov qauv lossis ploj tawm cov lus ceeb toom.
* Yuav tsum muaj rau cov animation hauv plugins
Ib tug streamlined, tab sis saj zawg zog, coj nyob rau hauv ib txwm javascript modal plugin nrog tsuas yog qhov tsawg kawg nkaus yuav tsum functionality thiab ntse defaults.
Download tau ntaub ntawvHauv qab no yog statically rendered modal.
Ib lub cev zoo…
Toggle ib modal ntawm javascript los ntawm nias lub pob hauv qab no. Nws yuav swb thiab ploj mus los ntawm sab saum toj ntawm nplooj ntawv.
Tua tawm demo modalHu rau modal ntawm javascript:
- $ ( '#myModal' ). modal ( kev xaiv )
Lub npe | hom | ua ntej | piav qhia |
---|---|---|---|
keeb kwm yav dhau | boolean | muaj tseeb | Xws li ib qho modal-backdrop element. Xwb, qhia meej static rau ib qho backdrop uas tsis kaw lub modal ntawm nias. |
keyboard | boolean | muaj tseeb | Kaw lub modal thaum khiav qhov tseem ceeb yog nias |
ua yeeb yam | boolean | muaj tseeb | Qhia cov modal thaum pib. |
Koj tuaj yeem qhib modals ntawm koj nplooj ntawv yooj yim yam tsis tas yuav sau ib kab ntawm javascript. Tsuas yog teem caij data-toggle="modal"
rau tus maub los lub caij nrog ib data-target="#foo"
lossis href="#foo"
uas sib haum mus rau ib qho qauv id, thiab thaum nias, nws yuav tso koj cov modal.
Tsis tas li, txhawm rau ntxiv cov kev xaiv rau koj qhov piv txwv modal, tsuas yog suav nrog lawv ua cov ntaub ntawv ntxiv rau ntawm tus tswj lub caij lossis modal markup nws tus kheej.
- <a class = "btn" data-toggle = "modal" href = "#myModal"> Launch Modal </a>
- <div class = "modal hide" id = "myModal" >
- <div class = "modal-header" >
- <button type = "button" class = "kaw" data-dismiss = "modal" > × </button>
- <h3> Modal header </h3>
- </div>
- <div class = "modal-body" >
- <p> Ib lub cev zoo… </p>
- </div>
- <div class = "modal-footer" >
- <a href="#" class="btn" data-dismiss = "modal"> Kaw </a> _ _ _ _ _
- <a href="#" class="btn btn-primary"> Txuag hloov pauv </a> _ _
- </div>
- </div>
.fade
chav kawm rau lub
.modal
caij (saib rau qhov demo kom pom qhov no hauv kev nqis tes ua) thiab suav nrog bootstrap-transition.js.
Activates koj cov ntsiab lus raws li ib tug modal. Txais ib qho kev xaiv xaiv object
.
- $ ( '#myModal' ). modal ({
- keyboard : cuav
- })
Manually toggles ib modal.
- $ ( '#myModal' ). modal ( 'toggle' )
Manually qhib lub modal.
- $ ( '#myModal' ). modal ( 'qhia' )
Manually hides ib modal.
- $ ( '#myModal' ). modal ( 'Hide' )
Bootstrap's modal class exposes ob peb txheej xwm rau hooking rau hauv modal functionality.
Kev tshwm sim | Kev piav qhia |
---|---|
ua yeeb yam | Qhov xwm txheej no tua hluav taws tam sim ntawd thaum show hu ua piv txwv. |
qhia | Qhov kev tshwm sim no raug rho tawm haujlwm thaum lub modal tau ua kom pom rau tus neeg siv (yuav tos rau css kev hloov pauv kom tiav). |
zais | Qhov xwm txheej no raug rho tawm haujlwm tam sim ntawd thaum hide hu ua piv txwv txoj kev. |
zais cia | Qhov kev tshwm sim no raug rho tawm haujlwm thaum lub modal tiav lawm muab zais los ntawm tus neeg siv (yuav tos rau css hloov mus ua kom tiav). |
- $ ( '#myModal' ). ntawm ( 'hidden' , function () {
- // ua ib yam dab tsi…
- })
Ntxiv dropdown menus rau yuav luag txhua yam hauv Bootstrap nrog qhov yooj yim plugin no. Bootstrap nta tag nrho dropdown zaub mov txhawb nyob rau hauv lub navbar, tabs, thiab tshuaj.
Download tau ntaub ntawvNyem rau ntawm qhov dropdown nav txuas hauv navbar thiab cov tshuaj hauv qab no txhawm rau kuaj cov ntawv poob.
Hu rau dropdowns ntawm javascript:
- $ ( '.dropdown-toggle' ). poob ( )
Txhawm rau nrawm ntxiv kev ua haujlwm poob qis rau txhua lub caij tsuas yog ntxiv data-toggle="dropdown"
thiab txhua qhov kev siv tau bootstrap dropdown yuav tau qhib.
data-target="#fat"
lossis
href="#fat"
.
- <ul class = "nav nav-pills" >
- <li class = "active" ><a href = "#" > Regular link </a></li>
- <li class = "dropdown" id = "menu1" >
- <a class = "dropdown-toggle" data-toggle = "dropdown" href = "#menu1"> _
- poob
- <b class = "caret" ></b>
- </a>
- <ul class = "dropdown-menu" >
- <li><a href = "#" > Action </a></li>
- <li><a href = "#" > Lwm yam </a></li>
- <li><a href = "#" > Lwm yam ntawm no </a></li>
- <li class = "divider" ></li>
- <li><a href = "#" > sib cais </a></li>
- </ul>
- </li>
- ...
- </ul>
Txhawm rau khaws URLs kom zoo, siv tus data-target
cwj pwm tsis yog href="#"
.
- <ul class = "nav nav-pills" >
- <li class = "dropdown" >
- <a class = "dropdown-toggle" data-toggle = "dropdown" data-target = "#" href = "path/to/page.html"> _
- poob
- <b class = "caret" ></b>
- </a>
- <ul class = "dropdown-menu" >
- ...
- </ul>
- </li>
- </ul>
Lub programatic api rau qhib cov ntawv qhia zaub mov rau ib qho navbar muab lossis tabbed navigation.
Lub ScrollSpy plugin yog rau kev hloov kho nav lub hom phiaj raws li txoj haujlwm scroll.
Download tau ntaub ntawvScroll thaj chaw hauv qab no thiab saib qhov hloov tshiab navigation. Lub dropdown sub khoom yuav tsum highlighted thiab. Sim nws!
Ad leggings keytar, brunch id art party dolor laboure. Pitchfork yr enim lo-fi ua ntej lawv muag tawm qui. Tumblr ua liaj ua teb-rau- rooj tsheb kauj vab txoj cai txawm li cas los xij. Ntxim hlub cardigan. Velit seitan mcsweeney's photo booth 3 hma hli irure. Cosby sweater lomo jean luv, williamsburg hoodie minim qui koj tej zaum tsis tau hnov txog lawv thiab 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 hwj txwv. Freegan hwj txwv aliqua cupidatat mcsweeney's vero. Cupidatat plaub loko nisi, ea helvetica nulla carles. Tattooed cosby sweater zaub mov tsheb, mcsweeney's quis non freegan vinyl. Lo-fi wes anderson +1 sartorial. Carles tsis zoo nkauj exercitation quis gentrify. Brooklyn adipisicing khoom siv tes ua npias vice keytar deserunt.
Occaecat commodo aliqua delectus. Fap craft npias deserunt skateboard ea. Lomo tsheb kauj vab txoj cai adipisicing banh mi, velit ea sunt qib tom ntej locavore ib leeg-hauv paus kas fes hauv magna veniam. High life id vinyl, ncho park consequat quis aliquip banh mi pitchfork. Vero VHS yog adipisicing. Consectetur nisi DIY minim tub txib hnab. Cred ex nyob rau hauv, sustainable delectus consectetur fanny pob 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 xijpeem delectus food truck. Sapiente synth id assumenda. Locavore sed helvetica cliche irony, thundercats tej zaum koj tsis tau hnov txog lawv ua rau hoodie gluten-dawb lo-fi fap aliquip. Labore elit placeat ua ntej lawv muag tawm, terry richardson proident brunch nesciunt quis cosby sweater pariatur keffiyeh ut helvetica artisan. Cardigan craft npias seitan readymade velit. VHS Chambray Laboris Tempor Veniam. Anim mollit minim commodo ullamco thundercats.
Hu rau scrollspy ntawm javascript:
- $ ( '#navbar' ). scrollspy ()
Txhawm rau yooj yim ntxiv tus cwj pwm scrollspy rau koj qhov topbar navigation, tsuas yog ntxiv data-spy="scroll"
rau lub caij koj xav soj ntsuam (feem ntau qhov no yuav yog lub cev).
- <body data-spy = "scroll" > ... </body>
<a href="#home">home</a>
yuav tsum sib haum mus rau ib yam dab tsi nyob rau hauv lub dom zoo li
<div id="home"></div>
.
Thaum siv scrollspy ua ke nrog kev ntxiv lossis tshem tawm cov ntsiab lus los ntawm DOM, koj yuav tsum hu rau txoj kev hloov tshiab zoo li:
- $ ( '[data-spy="scroll"]' ). txhua ( function () {
- var $spy = $ ( this ). scrollspy ( 'tshiab' )
- });
Lub npe | hom | ua ntej | piav qhia |
---|---|---|---|
offset | tus lej | 10 | Pixels rau offset los ntawm sab saum toj thaum xam txoj hauj lwm ntawm scroll. |
Kev tshwm sim | Kev piav qhia |
---|---|
qhib | Qhov xwm txheej no tua hluav taws thaum twg ib yam khoom tshiab tau qhib los ntawm scrollspy. |
Cov plugin no ntxiv ceev, dynamic tab thiab ntsiav tshuaj ua haujlwm rau kev hloov pauv los ntawm cov ntsiab lus hauv zos.
Download tau ntaub ntawvNyem cov tabs hauv qab no kom toggle ntawm cov panes zais, txawm tias los ntawm cov ntawv qhia zaub mov.
Raw denim tej zaum koj tsis tau hnov txog lawv cov ris tsho luv Austin. Nesciunt tofu stumptown aliqua, retro synth master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica. Reprehenderit neeg tua tsiaj 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, neeg tua tsiaj 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 ua ntej lawv muag tawm tswv ntxuav gluten-dawb squid scenester freegan cosby sweater. Fanny pob portland seitan DIY, kos duab tog locavore hma cliche siab lub neej ncha park Austin. Cred vinyl keffiyeh DIY salvia PBR, banh mi ua ntej lawv muag tawm ua liaj ua teb-rau- rooj VHS kab mob locavore cosby sweater. Lomo hma viral, mustache readymade thundercats keffiyeh craft npias marfa ethical. Hma salvia freegan, sartorial keffiyeh ncha park vegan.
Qhib tabbable tabs ntawm javascript (txhua tab yuav tsum tau qhib ib tus zuj zus):
- $ ( '#myTab a' ). nyem ( function ( e ) {
- e . PreventDefault ();
- $ ( qhov no ). tab ( 'show' );
- })
Koj tuaj yeem qhib ib tus neeg tab hauv ntau txoj hauv kev:
- $ ( '#myTab a[href="#profile"]' ). tab ( 'show' ); // Xaiv tab los ntawm lub npe
- $ ( '#myTab a: ua ntej' ). tab ( 'show' ); // Xaiv thawj tab
- $ ( '#myTab a:last' ). tab ( 'show' ); // Xaiv lub tab kawg
- $ ( '#myTab li:eq(2) a' ). tab ( 'show' ); // Xaiv thib peb tab (0-indexed)
Koj tuaj yeem qhib lub tab lossis ntsiav tshuaj navigation yam tsis tau sau ib qho javascript los ntawm kev qhia yooj yim data-toggle="tab"
lossis data-toggle="pill"
ntawm lub ntsiab lus. Ntxiv cov nav
thiab nav-tabs
cov chav kawm rau lub tab ul
yuav siv lub bootstrap tab styling.
- <ul class = "nav nav-tabs" >
- <li><a href = "#home" data-toggle = "tab"> Tsev </a></li >
- <li><a href = "#profile" data-toggle = "tab"> Profile </a></li >
- <li><a href = "#messages" data-toggle = "tab"> Messages </a></li >
- <li><a href = "#settings" data-toggle = "tab"> Settings </a></li >
- </ul>
Activates lub tab element thiab cov ntsiab lus ntim. Tab yuav tsum muaj ib data-target
lossis ib lub href
hom phiaj rau lub thawv ntim hauv DOM.
- <ul class = "nav nav-tabs" id = "myTab" >
- <li class = "active" ><a href = "#home"> Tsev </a></li >
- <li><a href = "#profile"> Profile </a> </li>
- <li><a href = "#messages"> Messages </a> </li>
- <li><a href = "#settings" > Settings </a></li>
- </ul>
- <div class = "tab-content" >
- <div class = "tab-pane active" id = "home" > ... </div>
- <div class = "tab-pane" id = "profile" > ... </div>
- <div class = "tab-pane" id = "messages" > ... </div>
- <div class = "tab-pane" id = "settings" > ... </div>
- </div>
- <script>
- $ ( function () {
- $ ( '#myTab a:last' ). tab ( 'show' );
- })
- </script>
Kev tshwm sim | Kev piav qhia |
---|---|
ua yeeb yam | Qhov kev tshwm sim no tua hluav taws ntawm tab qhia, tab sis ua ntej tab tshiab tau tshwm sim. Siv event.target thiab event.relatedTarget tsom rau lub tab active thiab yav dhau los active tab (yog tias muaj) feem. |
qhia | Qhov kev tshwm sim no tua hluav taws ntawm tab qhia tom qab tau pom tab. Siv event.target thiab event.relatedTarget tsom rau lub tab active thiab yav dhau los active tab (yog tias muaj) feem. |
- $ ( 'a[data-toggle="tab"]' ). on ( 'qhia' , function ( e ) {
- e . phiaj // activated tab
- e . RelatedTarget // yav dhau los tab
- })
Kev tshoov siab los ntawm qhov zoo tshaj plaws jQuery.tipsy plugin sau los ntawm Jason Frame; Cov lus qhia yog qhov hloov kho tshiab, uas tsis tso siab rau cov duab, siv css3 rau cov duab, thiab cov ntaub ntawv-tus cwj pwm rau cov npe hauv zos.
Download tau ntaub ntawvHover tshaj qhov txuas hauv qab no kom pom cov lus qhia:
Tight ris tom ntej no keffiyeh tej zaum koj yuav tsis tau hnov txog lawv. Diam duab lub rooj muag zaub beard raw denim letterpress vegan tub txib hnab stumptown. Farm-to-table seitan, mcsweeney's fixie sustainable quinoa 8-ntsis american apparel muaj terry richardson vinyl chambray. Beard stumptown, cardigans banh mi lomo thundercats. Tofu biodiesel williamsburg marfa, plaub loko mcsweeney's cleanse vegan chambray. Ib tus kws txawj ntse tiag tiag txawm li cas los xij keytar , scenester ua liaj ua teb-rau- rooj banksy Austin twitter tuav freegan cred nyoos denim ib leeg-hauv paus kas fes kis.
Tig lub tooltip ntawm javascript:
- $ ( '#example' ). tooltip ( Options )
Lub npe | hom | ua ntej | piav qhia |
---|---|---|---|
animation | boolean | muaj tseeb | siv css ploj mus rau cov lus qhia |
tso chaw | txoj hlua | ua haujlwm | 'sab saum toj' | yuav ua li cas rau position lub tooltip - sab saum toj | hauv qab | sab laug | txoj cai |
xaiv | txoj hlua | cuav | Yog hais tias muaj ib tug selector, tooltip cov khoom yuav raug delegated rau lub hom phiaj teev. |
lub npe | hlua | muaj nuj nqi | '' | default title value yog 'title' tag tsis nyob |
ua rau | txoj hlua | 'hover' | yuav ua li cas tooltip yog triggered - hover | tsom | phau ntawv |
ncua | tus lej | khoom | 0 | ncua kev qhia thiab zais cov lus qhia (ms) - tsis siv rau phau ntawv txhais hom Yog tias muaj tus lej nkag, ncua sijhawm yog siv rau ob qho tib si zais / qhia Object structure yog: |
Rau kev ua tau zoo vim li cas, Tooltip thiab Popover cov ntaub ntawv-apis yog xaiv rau hauv. Yog tias koj xav siv lawv tsuas yog qhia qhov kev xaiv xaiv.
- <a href="#" rel = "tooltip" title = "thawj tooltip" > hover over me </a>
Txuas tus tooltip handler rau ib qho khoom sau.
Qhia ib lub ntsiab lus qhia.
- $ ( '#element' ). tooltip ( 'show' )
Hide ib lub ntsiab lus qhia.
- $ ( '#element' ). tooltip ( 'Hide' )
Toggles ib lub ntsiab lus qhia.
- $ ( '#element' ). tooltip ( 'toggle' )
Ntxiv me me ntawm cov ntsiab lus, zoo li cov hauv iPad, rau txhua lub hauv paus rau cov ntaub ntawv thib ob hauv tsev.
* Yuav tsum muaj Tooltip kom suav nrog
Download tau ntaub ntawvHover tshaj lub khawm kom ua rau lub popover.
Qhib popovers ntawm javascript:
- $ ( '#example' ). popover ( kev xaiv )
Lub npe | hom | ua ntej | piav qhia |
---|---|---|---|
animation | boolean | muaj tseeb | siv css ploj mus rau cov lus qhia |
tso chaw | txoj hlua | ua haujlwm | 'txoj cai' | yuav ua li cas tso lub popover - saum | hauv qab | sab laug | txoj cai |
xaiv | txoj hlua | cuav | Yog hais tias muaj ib tug selector, tooltip cov khoom yuav raug delegated rau lub hom phiaj |
ua rau | txoj hlua | 'hover' | yuav ua li cas tooltip yog triggered - hover | tsom | phau ntawv |
lub npe | hlua | muaj nuj nqi | '' | default title value yog 'title' attribute tsis nyob |
cov ntsiab lus | hlua | muaj nuj nqi | '' | default ntsiab lus tus nqi yog 'cov ntaub ntawv-cov ntsiab lus' tus cwj pwm tsis nyob |
ncua | tus lej | khoom | 0 | ncua kev qhia thiab zais qhov popover (ms) - tsis siv rau phau ntawv txhais hom Yog tias muaj tus lej nkag, ncua sijhawm yog siv rau ob qho tib si zais / qhia Object structure yog: |
Rau kev ua tau zoo vim li cas, Tooltip thiab Popover cov ntaub ntawv-apis yog xaiv rau hauv. Yog tias koj xav siv lawv tsuas yog qhia qhov kev xaiv xaiv.
Initializes popovers rau ib qho khoom sau.
Tshaj tawm cov ntsiab lus popover.
- $ ( '#element' ). popover ( 'show' )
Hide cov ntsiab lus popover.
- $ ( '#element' ). popover ( 'hide' )
Toggles lub ntsiab lus popover.
- $ ( '#element' ). popover ( 'toggle' )
Lub ceeb toom plugin yog chav kawm me me ntxiv rau kev ua haujlwm ze rau kev ceeb toom.
Download tauCov lus ceeb toom plugin ua haujlwm ntawm cov lus ceeb toom tsis tu ncua, thiab thaiv cov lus.
Hloov qhov no thiab qhov ntawd thiab sim dua. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras mattis consectetur purus zaum amet fermentum.
Pab kom tshem tawm ntawm kev ceeb toom ntawm javascript:
- $ ( ".alert" ). ceeb toom ( )
Tsuas yog ntxiv data-dismiss="alert"
rau koj lub khawm kaw kom tau txais kev ceeb toom kaw ua haujlwm.
- <a class = "kaw" data-dismiss = "alert" href = "#" > × </a>
Wraps tag nrho cov lus ceeb toom nrog ze functionality. Txhawm rau kom koj cov lus ceeb toom tawm thaum kaw, xyuas kom lawv muaj cov chav kawm .fade
thiab .in
cov chav kawm twb tau thov rau lawv.
Kaw ceeb toom.
- $ ( ".alert" ). ceeb toom ( 'kaw' )
Bootstrap's alert class exposes ob peb txheej xwm rau hooking rau hauv alert functionality.
Kev tshwm sim | Kev piav qhia |
---|---|
kaw | Qhov xwm txheej no tua hluav taws tam sim ntawd thaum close hu ua piv txwv. |
kaw | Qhov kev tshwm sim no raug rho tawm haujlwm thaum lub ceeb toom tau raug kaw (yuav tos rau css kev hloov pauv kom tiav). |
- $ ( '#my-alert' ). khi ( 'kaw' , ua haujlwm () {
- // ua ib yam dab tsi…
- })
Tau txais cov qauv tsim thiab hloov pauv hloov pauv rau cov khoom sib tsoo zoo li accordions thiab navigation.
Download tau ntaub ntawv* Yuav tsum muaj Transitions plugin kom suav nrog.
Siv lub cev qhuav dej, peb tsim ib qho yooj yim accordion style widget:
Enable ntawm javascript:
- $ ( ".collapse" ). poob ( )
Lub npe | hom | ua ntej | piav qhia |
---|---|---|---|
niam txiv | xaiv | cuav | Yog tias selector ces tag nrho cov ntsiab lus collapsible nyob rau hauv cov niam txiv uas tau teev tseg yuav raug kaw thaum cov khoom no collapsible tshwm sim. (zoo ib yam li kev coj cwj pwm accordion) |
toggle | boolean | muaj tseeb | Toggles lub caij collapsible ntawm invocation |
Tsuas yog ntxiv data-toggle="collapse"
thiab ib qho data-target
rau lub caij kom tau txais kev tswj hwm ntawm lub caij collapsible. Tus data-target
cwj pwm lees txais css xaiv los siv lub cev qhuav dej rau. Nco ntsoov ntxiv cov chav kawm collapse
rau lub caij collapsible. Yog tias koj xav kom nws qhib lub neej ntawd, ntxiv cov chav kawm ntxiv in
.
- <button class = "btn btn-danger" data-toggle = "collapse" data-target = "#demo" >
- yooj yim collapsible
- </button>
- <div id = "demo" class = "collapse in" > … </div>
data-parent="#selector"
. Xa mus rau qhov demo kom pom qhov no hauv kev nqis tes ua.
Activates koj cov ntsiab lus raws li ib tug collapsible caij. Txais ib qho kev xaiv xaiv object
.
- $ ( '#myCollapsible' ). ploj ({
- toggle : cuav
- })
Toggles lub caij collapsible kom pom los yog zais.
Qhia ib lub caij collapsible.
Hide ib lub caij collapsible.
Bootstrap's collapse class exposes ob peb txheej xwm rau hooking mus rau hauv vau functionality.
Kev tshwm sim | Kev piav qhia |
---|---|
ua yeeb yam | Qhov xwm txheej no tua hluav taws tam sim ntawd thaum show hu ua piv txwv. |
qhia | Qhov kev tshwm sim no raug rho tawm haujlwm thaum lub caij sib tsoo tau ua kom pom rau tus neeg siv (yuav tos rau css kev hloov pauv kom tiav). |
zais | Qhov kev tshwm sim no raug rho tawm haujlwm tam sim ntawd thaum hide hu ua txoj kev. |
zais cia | Qhov kev tshwm sim no raug rho tawm haujlwm thaum lub caij sib tsoo tau muab zais los ntawm tus neeg siv (yuav tos rau css kev hloov pauv kom tiav). |
- $ ( '#myCollapsible' ). ntawm ( 'hidden' , function () {
- // ua ib yam dab tsi…
- })
Ib tug generic plugin rau cycling los ntawm cov ntsiab lus. Kev lom zem-mus-round.
Download tau ntaub ntawvSaib cov slideshow hauv qab no.
Hu los ntawm javascript:
- $ ( '.carousel' ). carousel ()
Lub npe | hom | ua ntej | piav qhia |
---|---|---|---|
lub sijhawm | tus lej | 5000 | Lub sijhawm ncua sijhawm ntawm kev caij tsheb kauj vab ib yam khoom. Yog hais tias tsis tseeb, carousel yuav tsis cia li voj voog. |
nres | txoj hlua | "hover" | Pauses kev caij tsheb kauj vab ntawm lub carousel ntawm mouseenter thiab rov pib caij tsheb kauj vab ntawm lub carousel ntawm mouseleave. |
Cov ntaub ntawv tus cwj pwm yog siv rau kev tswj hwm yav dhau los thiab tom ntej. Mus saib cov piv txwv markup hauv qab no.
- <div id = "myCarousel" class = "carousel swb" >
- <!-- Carousel khoom -->
- <div class = "carousel-inner" >
- <div class = "active item" > … </div>
- <div class = "item" > … </div>
- <div class = "item" > … </div>
- </div>
- <!-- Carousel nav -->
- <a class = "carousel-control left" href = "#myCarousel" data-slide = "prev" > ‹ </a>
- <a class = "carousel-tswj txoj cai" href = "#myCarousel" data-slide = "tom ntej" > › </a>
- </div>
Pib lub carousel nrog ib qho kev xaiv xaiv object
thiab pib caij tsheb kauj vab los ntawm cov khoom.
- $ ( '.carousel' ). carousel ({
- Lub sijhawm : 2000
- })
Cycles los ntawm cov khoom carousel ntawm sab laug mus rau sab xis.
Nres lub carousel los ntawm kev caij tsheb kauj vab los ntawm cov khoom.
Cycles lub carousel rau ib lub thav duab (0 raws li, zoo ib yam li ib qho array).
Lub voj voog mus rau qhov khoom dhau los.
Cycles mus rau yam khoom tom ntej.
Bootstrap's carousel class exposes ob txheej xwm rau hooking rau hauv carousel functionality.
Kev tshwm sim | Kev piav qhia |
---|---|
swb | Qhov xwm txheej no tua hluav taws tam sim ntawd thaum tus slide txheej txheem piv txwv raug hu. |
swb | Qhov kev tshwm sim no raug rho tawm haujlwm thaum lub carousel tau ua tiav nws txoj kev hloov pauv. |
Ib qho yooj yim, yooj yim txuas ntxiv plugin rau sai sai tsim elegant typeaheads nrog rau cov ntawv sau ntawv nkag.
Download tau ntaub ntawvPib ntaus ntawv hauv daim teb hauv qab no kom pom cov txiaj ntsig typeahead.
Hu rau typeahead ntawm javascript:
- $ ( '.typeahead' ). ntaus ntawv ( )
Lub npe | hom | ua ntej | piav qhia |
---|---|---|---|
qhov chaw | array | [] | Cov ntaub ntawv los nug tawm tsam. |
cov khoom | tus lej | 8 | Tus naj npawb max ntawm cov khoom los tso saib hauv qhov poob. |
tus sib tw | muaj nuj nqi | cas insensitive | Txoj kev siv los txiav txim siab seb qhov lus nug puas phim ib yam khoom. Txais ib qho kev sib cav, qhov item tawm tsam uas yuav sim cov lus nug. Nkag mus rau cov lus nug tam sim no nrog this.query . Rov qab ib qho boolean true yog tias cov lus nug yog qhov sib tw. |
tus txheej txheem | muaj nuj nqi | qhov tseeb match, case sensitive, case insensitive |
Txoj kev siv los txheeb cov txiaj ntsig autocomplete. lees txais ib qho kev sib cav items thiab muaj lub luag haujlwm ntawm qhov piv txwv typeahead. Siv cov lus nug tam sim no nrog this.query . |
highlighter | muaj nuj nqi | highlights tag nrho cov default match | Txoj kev siv los qhia txog cov txiaj ntsig autocomplete. lees txais ib qho kev sib cav item thiab muaj lub luag haujlwm ntawm qhov piv txwv typeahead. Yuav tsum rov html. |
Ntxiv cov ntaub ntawv tus cwj pwm los sau npe ib lub caij nrog typeahead functionality.
- <input type = "text" data-provide = "typeahead" >
Initializes ib tug input nrog ib tug typeahead.