JavaScript hmangin a rawn lang ang

Bootstrap-a component hrang hrangte chu nunna pe rawh—tunah chuan custom jQuery plugin 13 a awm tawh.

Lu a ti sang a! Heng docs te hi v2.3.2 tan a ni a, official takin a support tawh lo. Bootstrap version thar ber hi han en teh!

Mimal emaw, khawlkhawm emaw a ni thei

Plugin te hi pakhat zel (a then chuan dependency mamawh nei mahse), a nih loh leh vawi khatah dah vek theih a ni. Bootstrap.js leh bootstrap.min.js te hian file pakhatah plugin zawng zawng an nei vek a.

Data attribute te hi a ni

Bootstrap plugin zawng zawng hi JavaScript line khat pawh ziak lovin markup API hmang chauhvin i hmang thei ang. Hei hi Bootstrap-a first class API a ni a, plugin i hman hunah i ngaihtuah hmasak ber tur a ni.

Chutiang a nih lai chuan, dinhmun thenkhatah chuan he functionality hi off hi duhthusam a ni thei. Chuvangin, `'data-api'` hmanga body namespaced-a event awm zawng zawng unbind-a data attribute API disable theihna kan pe bawk. Hei hi hetiang hian a lang:

  1. $ ( 'taksa' ). off ( '.data-api' ) tih a ni.

A dang pawhin, plugin bik target tur chuan plugin hming chu namespace atan data-api namespace nen hetiang hian dah mai rawh:

  1. $ ( 'taksa' ). off ( '.alert.data-api' ) tih a ni.

Programmatic API hmanga siam a ni

Tin, Bootstrap plugin zawng zawng hi JavaScript API hmang chauhvin i hmang thei tur a ni tih kan ring bawk. Public API zawng zawng hi single, chainable method a ni a, collection acted on chu a rawn pe kir vek a ni.

  1. $ ( ".btn.hlauhawm" ). button ( "toggle" tih kha ). addClass ( "thau" ) a ni.

Method zawng zawng hian optional options object, method bik target tu string emaw, engmah (default behavior hmanga plugin initiate tu) emaw an pawm tur a ni:

  1. $ ( "#kaModal" ). modal () // default hmanga initialized a ni
  2. $ ( "#kaModal" ). modal ({ keyboard : false }) // keyboard awm lovin initialized a ni
  3. $ ( "#kaModal" ). modal ( 'show' ) // show chu a initialize a, a invoke nghal bawk

Plugin tin hian an raw constructor chu `Constructor` property-ah an expose bawk: $.fn.popover.Constructor. Plugin instance bik i hmuh duh chuan element atanga direct-in la chhuak rawh: $('[rel=popover]').data('popover').

Inhnialna a awm lo

A chang chuan Bootstrap plugins te hi UI framework dang nen hman a ngai thin. Hetiang dinhmunah hian namespace collision a awm fo thin. Chutiang a nih chuan i .noConflictvalue revert duh plugin chu i call thei ang.

  1. var bootstrapButton = $ 1000 a ni a, a man pawh a tlawm hle. fn a ni. button chu a rawn lang a. noConflict () // $.fn.button chu a hmaa value pek tawhah a rawn pe leh ang
  2. $ a ni. fn a ni. bootstrapBtn = bootstrapButton // $().bootstrapBtn hnenah bootstrap hnathawh dan tur pe rawh

Thil thlengte

Bootstrap hian plugin-a thil tih danglam bik tam zawk atan custom event a pe a. A tlangpuiin, hengte hi infinitive leh past participle form-ah an lo thleng a - chutah chuan showthilthleng pakhat tan tirh lamah infinitive (ex. ) chu a insiam a, a past participle form (ex. shown) chu thiltih zawh hunah a trigger a ni.

Infinitive event zawng zawng hian preventDefault functionality a pe vek a. Hei hian action pakhat execution chu a tan hmaa tihtawp theihna a pe a ni.

  1. $ ( '#kaModal' tih hi a ni). on ( ' entir' , function ( e ) { .
  2. if (! data ) return e . preventDefault () // modal a lan loh tur a titawp
  3. }) tih a ni.

Transition chungchang

Transition effect awlsam tak tak atan chuan JS file dangte bulah bootstrap-transition.js vawi khat dah tel bawk ang che. Compiled (or minified) bootstrap.js i hman chuan hei hi dah tel a ngai lo—a awm tawh.

Case hman dan tur

Transition plugin entirnan tlemte:

  • Modal-a slide emaw fading emaw a awm
  • Fading out tabs te chu
  • Fading out alerts a awm
  • Carousel panes te chu a rawn tlan chhuak a

Entirna te

Modal te hi streamlined, mahse flexible, dialog prompts a awm a, functionality mamawh tlem ber leh smart defaults te a awm bawk.

Static entirnan

Footer-a header, body leh action set awmna rendered modal.

  1. <div class = "modal thup fade" >
  2. <div class = "modal-a thupui" >
  3. <button type = "button" class = "khar" data-dismiss = "modal" aria-thup = "dik" > × </button> tih a ni
  4. <h3> Modal header </h3> tih a ni
  5. </div> tih a ni
  6. <div class = "modal-taksa" > tih hi a ni
  7. <p> Taksa tha tak pakhat... </p>
  8. </div> tih a ni
  9. <div class = "modal-a hnuai lam" >
  10. <a href = "#" class = "btn" > khar rawh </a>
  11. <a href = "#" class = "btn btn-primary" > Thil danglamte chu dahkhawm rawh </a>
  12. </div> tih a ni
  13. </div> tih a ni

Live demo a ni ang

JavaScript hmangin modal pakhat toggle la, a hnuaia button hi click la. A hnuai lam a pan ang a, page chunglam atang chuan a fade in ang.

  1. <!-- Button hmangin modal --> a tichhuak thei
  2. <a href = "#myModal" role = "button" class = "btn" data-toggle = "modal" > Demo modal chu tlangzarh rawh </a>
  3.  
  4. <!-- Modal --> tih a ni
  5. <div id = "kaModal" class = "modal thup fade" tabindex = "-1" role = "dialog" aria-labelledby = "kaModalLabel" aria-thup = "dik" >
  6. <div class = "modal-a thupui" >
  7. <button type = "button" class = "khar" data-dismiss = "modal" aria-thup = "dik" > × </button>
  8. <h3 id = "myModalLabel" > A chhuahna tur hmun leh a hmanna tur hmun </h3 >
  9. </div> tih a ni
  10. <div class = "modal-taksa" > tih hi a ni
  11. <p> Taksa tha tak pakhat... </p>
  12. </div> tih a ni
  13. <div class = "modal-a hnuai lam" >
  14. <button class = "btn" data-dismiss = "modal" aria-hidden = "dik" > Khar rawh </button>
  15. <button class = "btn btn-primary" > Thil danglamte chu save rawh </button>
  16. </div> tih a ni
  17. </div> tih a ni

Hman dan tur

Data attribute hmangin a ni

JavaScript ziak lovin modal pakhat activate rawh. data-toggle="modal"Controller element, button ang chi, a data-target="#foo"or href="#foo"toggle tur modal bik target tur nen set rawh .

  1. <button type = "button" data-toggle = "modal" data-target = "#myModal" > Modal </button> tihchhuah a ni

JavaScript hmangin

myModalJavaScript line khata id nei modal chu ko rawh :

  1. $ ( '#kaModal' tih hi a ni). modal ( duhthlan tur ) .

Thil thlan theih a ni

Options chu data attribute emaw JavaScript hmangin pass theih a ni. Data attribute atan chuan option hming chu , ah hian append la data-, data-backdrop="".

Hming lampang hlawhchhamna hrilhfiahna
backdrop a ni boolean a ni dik Modal-backdrop element a awm bawk. staticA nih loh leh, click-a modal khar lo backdrop atan specify bawk ang che.
keyboard hmangin a ziak a boolean a ni dik Escape key i hmet chuan modal a khar thin
lantir boolean a ni dik Initialized hunah modal a lantir.
hla kawng diklo

Remote url pek a nih chuan jQuery’s loadmethod hmangin content chu load a ni ang a, .modal-body. Data api i hman chuan a danglamna chu hreftag hmangin remote source i tarlang thei bawk. Chumi entirnan a hnuaia mi ang hian tarlan a ni:

  1. <a data-toggle="modal" href="remote.html" data-target="#modal">click me</a>

Thiltih dan tur

.modal(thil thlan theih) .

I content chu modal angin a activate thin. A pawm a, optional options a awm objectbawk .

  1. $ ( '#kaModal' tih hi a ni). modal ({ ) a ni.
  2. keyboard : a dik lo
  3. }) tih a ni.

.modal(‘toggle’) tih a ni.

Modal pakhat chu manual in a toggle thin.

  1. $ ( '#kaModal' tih hi a ni). modal ( 'toggle' tih a ni.

.modal(' entir') tih a ni.

Manual takin modal a hawng thin.

  1. $ ( '#kaModal' tih hi a ni). modal ( 'tihlan rawh' ) .

.modal(‘thup’) tih a ni.

Manual takin modal a thup thin.

  1. $ ( '#kaModal' tih hi a ni). modal ( ‘thup’ ) tih a ni.

Thil thlengte

Bootstrap-a modal class hian modal functionality-a hooking-na tur event tlemte a pholang a ni.

Hunbik Hrilhfiahna
lantir showHe event hi instance method kan koh chuan a fire nghal vek a ni.
tih a ni He event hi modal chu user hmuh theiha siam a nih hunah fire a ni (css transitions zawh hun a nghak ang).
biru hideHe event hi instance method koh a nih chuan a fire nghal a ni.
thuhruk He event hi modal chu user hnen atanga thup a nih zawh chuan a fire thin (css transitions zawh hun a nghak ang).
  1. $ ( '#kaModal' tih hi a ni). on ( 'thup' , hnathawh () { .
  2. // thil engemaw ti rawh...
  3. }) tih a ni.

Entirnan navbar ah

ScrollSpy plugin hi scroll position a zirin nav target te automatic a update theihna tur a ni. Navbar hnuaia area chu scroll la, active class inthlak dan chu en rawh. Dropdown sub items te pawh a rawn lang ang.

@thau

A rilru a buai em em a, a rilru a hah em em bawk a. Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi an hralh chhuah hma qui. Tumblr farm-to-table bicycle dikna eng pawh ni se. Anim keffiyeh chuan carles cardigan a ti a. Velit seitan mcsweeney thlalak booth 3 savawm thla irure. A rilru a buai em em a, a rilru a hah em em bawk a, a rilru a buai em em bawk a, a rilru a hah em em bawk a, a rilru a hah em em bawk a, a rilru a hah em em bawk a. et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh kut hnathawktu ullamco consequat.

@mdo a ni

Veniam marfa hmul nei skateboard, adipisicing fugiat velit pitchfork hmul. A rilru a buai em em a, a rilru a hah em em bawk a. mcsweeney's vero. Cupidatat pali loko nisi, ea helvetica nulla carles. Tattoo nei cosby sweater ei tur phur truck, mcsweeney-a quis non freegan vinyl a ni. Lo-fi wes anderson +1 chuan a rawn ti a. A rilru a buai em em a, a rilru a hah em em bawk a. Carles non aesthetic exercise quis gentrify. Brooklyn adipisicing kutchhuak beer vice keytar deserunt a ni.

pakhat

Occaecat commodo a ni a, a hring dup bawk. A rilru a buai em em a, a rilru a hah em em bawk a. Fap craft beer deserunt skateboard ea. Lomo bicycle rights adipisicing banh mi, velit ea sunt next level locavore pakhat chauh awmna coffee in magna veniam. Nunna sang id vinyl, echo park consequat quis aliquip banh mi pitchfork. Vero VHS chuan a ti a. A rilru a buai em em a, a rilru a hah em em bawk a. DiY minim messenger bag. A rilru a hah lutuk chuan a rilru a buai em em a, a rilru a hah lutuk chuan a rilru a buai em em bawk a. fanny pack iphone.

pahnih

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.

three

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 eng pawh delectus ei tur phur truck. A rilru a buai em em a, a rilru a hah em em bawk a. id assumenda. Locavore sed helvetica cliche irony, thundercats te hi i hre lo mai thei consequat hoodie gluten-free lo-fi fap aliquip. Laboure elit placeat an hralh zawh hmain, terry richardson proident brunch nesciunt quis cosby sweater pariatur keffiyeh ut helvetica artisan. Cardigan craft beer seitan siam fel vek velit a ni. VHS chambray laboris hun rei lote chhunga hman theih a ni. A rilru a buai em em a, a rilru a hah em em bawk a.


Hman dan tur

Data attribute hmangin a ni

I topbar navigation-a awlsam taka scrollspy behavior dah belh data-spy="scroll"tur chuan spy duh element-ah dah mai la (a tlangpuiin hei hi body a ni ang) leh data-target=".navbar"eng nav nge hman tur tih thlang rawh. Component pakhat nen scrollspy i hmang duh ang .nav.

  1. <taksa data-spy = "scroll" data-target = ".navbar" > ... </body> tih hi a ni

JavaScript hmangin

JavaScript hmangin scrollspy chu ko rawh:

  1. $ ( '#navbar' tih chu a ni). lehkhabu zial () .
Lu a ti sang a! Navbar link ah hian resolvable id target a awm tur a ni. Entirnan, a <a href="#home">home</a>chu dom-a thil awm ang chi nen a inmil tur a <div id="home"></div>ni.

Thiltih dan tur

.scrollspy(‘refresh’) tih a ni.

DOM atanga elements dah belh emaw paih emaw nena inzawma scrollspy hman hian refresh method chu hetiang hian i ko a ngai ang:

  1. $ ( '[data-spy="scroll"]' tih a ni ang. pakhat zel ( hnathawh () { .
  2. var $spy = $ ( hei hi ) a ni. scrollspy ( ‘thar thar’ ) tih a ni.
  3. });

Thil thlan theih a ni

Options chu data attribute emaw JavaScript hmangin pass theih a ni. Data attribute atan chuan option hming chu , ah hian append la data-, data-offset="".

Hming lampang hlawhchhamna hrilhfiahna
offset a ni a zat 10 a ni Scroll awmna tur chhut hunah chunglam atanga offset tur pixels.

Thil thlengte

Hunbik Hrilhfiahna
activate rawh He event hi scrollspy-in item thar a activate apiangin a fire thin.

Entirna tabs te

Local content pane hmanga transition-ah tab functionality rang tak, chak tak dah belh la, dropdown menu hmang pawhin.

Raw denim i la hre lo mai thei jean shorts Austin. A rilru a hah lutuk chuan a rilru a buai em em a, a rilru a hah lutuk chuan a rilru a buai em em bawk a. Retro synth master cleanse. A rilru a hah lutuk chuan a rilru a buai em em a, a rilru a hah lutuk chuan a rilru a buai em em bawk a. A rilru a buai em em a, a rilru a hah em em bawk a. dreamcatcher synth. Cosby sweater eu banh mi, qui irure terry richardson ex squid a ni a, a man pawh a tlawm hle. A rilru a buai em em a, a rilru a hah em em bawk a. salvia cillum iphone. Seitan aliquip quis cardigan american thawmhnaw, sa thattu 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.


Hman dan tur

JavaScript hmangin tabbable tab te chu enable rawh (tab tinte chu a hranin activate a ngai a ni):

  1. $ ( '#kaTab a' ). click ( function ( e )) chu a rawn lang a.
  2. e . venhimnaDefault ();
  3. $ ( hei hi ). tab ( 'entir rawh' );
  4. }) tih a ni.

Tab hrang hrangte chu kawng hrang hrangin i activate thei ang:

  1. $ ( '#kaTab a[href="#profile"]' ). tab ( 'entir rawh' ); // Tab hming hmangin thlang rawh
  2. $ ( '#kaTab a: hmasa ber' ). tab ( 'entir rawh' ); // Tab hmasa ber thlang rawh
  3. $ ( '#kaTab a:a hnuhnung ber' ). tab ( 'entir rawh' ); // Tab hnuhnung ber thlang rawh
  4. $ ( '#ka Tab li:eq(2) a' ). tab ( 'entir rawh' ); // Tab pathumna thlang rawh (0-indexed) .

Markup a ni

JavaScript engmah ziak lovin tab emaw pill navigation emaw chu element pakhat specify data-toggle="tab"emaw on emaw mai mai hmangin i activate thei a ni. Tab-a and class te data-toggle="pill"dah chuan Bootstrap tab styling a apply ang.navnav-tabsul

  1. <ul class = "nav-tabs" > tih hi a awmzia a awm lo
  2. <li><a href = "#in" data-toggle = "tab" > A chhuahna tur hmun </a> </li>
  3. <li><a href = "#profile" data-toggle = "tab" > A rilru a hah lutuk chuan a rilru a buai em em a, a rilru a hah lutuk chuan a rilru a buai em em bawk a
  4. <li><a href = "#thuchah" data-toggle = "tab" > Thuchah </a></li>
  5. <li><a href = "#settings" data-toggle = "tab" > A chhuahna tur hmun leh a hmanna tur hmun </a></li>
  6. </ul> tih a ni

Thiltih dan tur

$().tab ah hian a awm

Tab element leh content container pakhat a activate thin. Tab hian DOM ah container node targeting a data-targetemaw a nei tur a ni.href

  1. A rilru a buai em em a, a rilru a hah em em bawk a. id = " myTab " >
  2. <li class = "active" ><a href = "#in" > In leh lo </a></li>
  3. <li><a href = "#profile" > A chhuahna tur hmun leh a hmanna tur hmun </a></li>
  4. <li><a href = "#thuchah" > Thuchah </a></li>
  5. <li><a href = "#settings" > A chhuahna tur hmun leh a hmanna tur hmun </a></li>
  6. </ul> tih a ni
  7.  
  8. <div class = "tab-a thu awmte" >
  9. <div class = "tab-pane active" id = "in" > ... </div> tih a ni
  10. A rilru a hah lutuk chuan a rilru a buai em em a, a rilru a hah lutuk chuan a rilru a buai em em bawk a. <div class = "tab-pane" id = "profile" > ... </div>
  11. <div class = "tab-pane" id = "thuchah" > ... </div> tih a ni
  12. <div class = "tab-pane" id = "settings" > ... </div> tih hi a ni
  13. </div> tih a ni
  14.  
  15. <script> tih a ni
  16. $ ( hnathawh () { .
  17. $ ( '#kaTab a:a hnuhnung ber' ). tab ( 'entir rawh' );
  18. }) tih a ni.
  19. </script> tih a ni

Thil thlengte

Hunbik Hrilhfiahna
lantir He event hi tab show-ah a fire a, mahse tab thar a lan hmain a fire thin. Active tab leh active tab hmasa (a awm chuan) te target turin event.targetand hmang ang che .event.relatedTarget
tih a ni He event hi tab pakhat a lan hnuah tab show ah a fire thin. Active tab leh active tab hmasa (a awm chuan) te target turin event.targetand hmang ang che .event.relatedTarget
  1. $ ( 'a[data-toggle="tab"]' tih a ni a, a hlawhtlinna chu a hlawhtlinna a ni. on ( 'a entir' , function ( e ) { .
  2. e . target // tihchhuah tab a ni
  3. e . relatedTarget // tab hmasa ber a ni
  4. }) tih a ni.

Entirna te

Jason Frame ziah jQuery.tipsy plugin tha tak atanga infuih thar; Tooltips hi updated version a ni a, image-ah a innghat lo va, animation atan CSS3 a hmang a, local title storage atan data-attribute a hmang bawk.

Performance avang hian tooltip leh popover data-apis te hi opt in a ni a, chu chu nangmah ngeiin i initialize tur tihna a ni .

A hnuaia link te hi hover la, tooltips i hmu ang:

Tight pants next level keffiyeh i la hre lo ngei ang. Thlalak booth hmul raw denim letterpress vegan palai bag stumptown. Farm-to-table seitan, mcsweeney-a fixie sustainable quinoa 8-bit american apparel te chuan terry richardson vinyl chambray an nei a, an thil siam chu an hlim hle. Beard stumptown, cardigans banh mi lomo zing khawvar. Tofu biodiesel williamsburg marfa, pali loko mcsweeney chuan vegan chambray a tifai a. A really ironic artisan whatever keytar , scenester farm-to-table banksy Austin twitter handle freegan cred raw denim single-origin coffee viral a ni.

Kawng pali

Input group hrang hrangah tooltips te

Bootstrap input groups nena tooltips leh popovers i hman hian containerduh loh side effects awm loh nan (a hnuaia documented) option kha i set a ngai ang.


Hman dan tur

JavaScript hmangin tooltip chu trigger la:

  1. $ ( '#entirna' ). tooltip ( duhthlan tur ) .

Thil thlan theih a ni

Options chu data attribute emaw JavaScript hmangin pass theih a ni. Data attribute atan chuan option hming chu , ah hian append la data-, data-animation="".

Hming lampang hlawhchhamna hrilhfiahna
animation tih a ni boolean a ni dik tooltip ah css fade transition hmangin apply rawh
html tih a ni boolean a ni diklo Tooltip ah hian html dah la. False a nih chuan jquery’s textmethod hmangin dom chhungah content kan dah ang. XSS attack i ngaihtuah chuan text hmang rawh.
dahna tur hmun a ni string | thiltih 'chung' tooltip dah dan tur - chunglam | hnuai lam | veilam | dik
selector a ni hrui diklo Selector pek a nih chuan tooltip object te chu target tarlan te hnenah delegate a ni ang.
nihna string | thiltih '' tih a ni. `title` tag a awm loh chuan default title value a ni
ti per hrui 'hover focus' tih a ni. tooltip a trigger dan - | tih kha click la hover rawh | focus | kuta thawh. Hriat tur chu i case pass trigger mutliple, space seperated, trigger chi hrang hrang.
titlai number | thil 0 a ni

tooltip (ms) entir leh thup delay - manual trigger type-ah a hman loh

Number supply a nih chuan hide/show pahnih ah delay a awm vek a ni

Thil awm dan tur chu:delay: { show: 500, hide: 100 }

container a ni string | diklo diklo

Tooltip chu element bik pakhatah a append thincontainer: 'body'

Lu a ti sang a! Tooltip hrang hrang atana option hrang hrangte chu data attribute hman hmangin a danglamna tur a awm thei bawk.

Markup a ni

  1. <a href = "#" data-toggle = "hmanrua" title = "hmanrua hmasa ber" > ka chungah hover rawh </a>

Thiltih dan tur

$().tooltip(thil thlan tur) .

Element collection pakhatah tooltip handler a attache thin.

.tooltip(' entir rawh') tih a ni.

Element pakhat tooltip a pholang.

  1. $ ( '#element' tih chu a ni). tooltip ( 'tihlan rawh' ) .

.tooltip(‘thup’) tih a ni.

Element pakhat tooltip a thup thin.

  1. $ ( '#element' tih chu a ni). hmanrua ( ‘thup’ ) .

.tooltip(‘toggle’) tih a ni.

Element pakhat tooltip a toggle thin.

  1. $ ( '#element' tih chu a ni). hmanrua ( 'toggle' ) tih a ni.

.tooltip('tihchhiat') tih a ni.

Element pakhat tooltip a thup a, a tichhia bawk.

  1. $ ( '#element' tih chu a ni). tooltip ( ‘tihchhiat’ ) .

Entirna te

Secondary information dahna tur element eng pawhah iPad-a awm ang chi content overlay te te dah belh rawh. Popover chu trigger turin button chungah hover rawh. Tooltip dah tel a ngai.

Static popover a ni

Option pali a awm a, chunglam, dinglam, hnuai lam, leh veilam aligned te an ni.

Popover chunglam a ni

A rilru a buai em em a, a rilru a hah em em bawk a. Aenean eu leo ​​quam a ni. A rilru a hah lutuk chuan a rilru a buai em em a, a rilru a hah lutuk chuan a rilru a buai em em bawk a.

Popover a dik e

A rilru a buai em em a, a rilru a hah em em bawk a. Aenean eu leo ​​quam a ni. A rilru a hah lutuk chuan a rilru a buai em em a, a rilru a hah lutuk chuan a rilru a buai em em bawk a.

Popover hnuai lam

A rilru a buai em em a, a rilru a hah em em bawk a. Aenean eu leo ​​quam a ni. A rilru a hah lutuk chuan a rilru a buai em em a, a rilru a hah lutuk chuan a rilru a buai em em bawk a.

Popover chu a chhuak ta a

A rilru a buai em em a, a rilru a hah em em bawk a. Aenean eu leo ​​quam a ni. A rilru a hah lutuk chuan a rilru a buai em em a, a rilru a hah lutuk chuan a rilru a buai em em bawk a.

Popover anga tarlan markup engmah hi JavaScript leh dataattribute chhunga content atanga siam a ni lo.

Live demo a ni ang

Kawng pali


Hman dan tur

JavaScript hmangin popovers te chu enable rawh:

  1. $ ( '#entirna' ). popover ( duhthlan tur ) .

Thil thlan theih a ni

Options chu data attribute emaw JavaScript hmangin pass theih a ni. Data attribute atan chuan option hming chu , ah hian append la data-, data-animation="".

Hming lampang hlawhchhamna hrilhfiahna
animation tih a ni boolean a ni dik tooltip ah css fade transition hmangin apply rawh
html tih a ni boolean a ni diklo Popover ah chuan html dah la. False a nih chuan jquery’s textmethod hmangin dom chhungah content kan dah ang. XSS attack i ngaihtuah chuan text hmang rawh.
dahna tur hmun a ni string | thiltih 'dik' popover dah dan tur - top | hnuai lam | veilam | dik
selector a ni hrui diklo selector pek a nih chuan tooltip object te chu target tarlan te hnenah delegate a ni ang
ti per hrui 'click' a ti a. popover a tihchhuah dan - | hover rawh | focus | kuta thawh
nihna string | thiltih '' tih a ni. `title` attribute a awm loh chuan default title value a ni
lungawi string | thiltih '' tih a ni. `data-content` attribute a awm loh chuan default content value a ni
titlai number | thil 0 a ni

popover (ms) lantir leh thup delay - manual trigger type-ah a hman loh

Number supply a nih chuan hide/show pahnih ah delay a awm vek a ni

Thil awm dan tur chu:delay: { show: 500, hide: 100 }

container a ni string | diklo diklo

Popover chu element bik pakhatah a append thincontainer: 'body'

Lu a ti sang a! Mimal popovers atana option te chu a danglamna chu data attribute hmanga tarlan theih a ni.

Markup a ni

Performance avang hian Tooltip leh Popover data-apis te hi opt in a ni a, i hman duh chuan selector option kha tarlang mai rawh.

Thiltih dan tur

$().popover(thil thlan theih) .

Element collection pakhat atan popovers a initialize thin.

.popover(' entir') tih a ni.

A elements popover a rawn pholang.

  1. $ ( '#element' tih chu a ni). popover ( 'tihlan rawh' ) .

.popover(‘thup’) tih a ni.

A elements popover a thup a.

  1. $ ( '#element' tih chu a ni). popover ( ‘thup’ ) tih a ni.

.popover('toggle') tih a ni.

A elements popover a tidanglam.

  1. $ ( '#element' tih chu a ni). popover ( 'toggle' tih hi a dik lo a ni.

.popover('tihchhiat') .

Element pakhat popover chu a thup a, a tichhe bawk.

  1. $ ( '#element' tih chu a ni). popover ( ‘tihchhiat’ ) .

Entirna alerts te

He plugin hmang hian alert message zawng zawngah dismiss functionality add vek ang che.

Guacamole thianghlim tak! Best check yo self, i hmel a tha lutuk lo.

Aw snap! Error i hmu a!

Hei leh chu thlak la, ti leh rawh. A rilru a buai em em a, a rilru a hah em em bawk a, a rilru a buai em em bawk a, a rilru a hah em em bawk a. A rilru a buai em em a, a rilru a hah em em bawk a.

He action hi la rawh A nih loh leh hetiang hian ti rawh


Hman dan tur

JavaScript hmanga alert dismissal theihna tur:

  1. $ ( ".alert" tih a ni. hriattirna () .

Markup a ni

I close button ah khan add mai la data-dismiss="alert", automatic in alert close functionality a pe ang.

  1. <a class = "khar" data-dismiss = "alert" href = "#" > × </a> tih a ni

Thiltih dan tur

$().alert() a ni.

Alert zawng zawng chu close functionality nen a wrap vek. I alerts te kha khar a nih hunah animate out theih nan, an chungah the .fadeand .inclass apply tawh an neih ngei ngei tur a ni.

.alert('khar') tih a ni.

Alert a khar thin.

  1. $ ( ".alert" tih a ni. alert ( 'khar' ) .

Thil thlengte

Bootstrap-a alert class hian alert functionality-a hook theihna tur thil thleng tlemte a pholang a ni.

Hunbik Hrilhfiahna
khar closeHe event hi instance method kan koh chuan a fire nghal vek a ni.
khar a ni He event hi alert khar a nih hunah fire a ni (css transitions zawh hun a nghak ang).
  1. $ ( '#ka-alert' ). bind ( 'khar' , function () { 1000 a ni.
  2. // thil engemaw ti rawh...
  3. }) tih a ni.

Entirna hman dan

Button hmangin tam zawk ti rawh. Control button state emaw toolbar ang chi component tam zawk tan button group siam emaw a ni.

Stateful tak a ni

data-loading-text="Loading..."Button pakhata loading state hman tur chuan add rawh .

  1. <button type = "button" class = "btn btn-primary" data-loading-text = "Loading mek..." > Loading dinhmun </button>

Toggle pakhat chauh a awm

data-toggle="button"Button pakhata toggling activate turin Add rawh .

  1. <button type = "button" class = "btn btn-primary" data-toggle = "button" > Thil pakhat chauh a awm </button>

Checkbox ah a awm

data-toggle="buttons-checkbox"btn-group-a checkbox style toggling tur chuan add rawh .

  1. A rilru a buai em em a, a rilru a hah em em bawk a
  2. <button type = "button" class = "btn btn-primary" > A veilam </button> a ni
  3. <button type = "button" class = "btn btn-primary" > A laiah </button> a ni
  4. <button type = "button" class = "btn btn-primary" > Dinglam </button> a ni a, a chhuahna tur hmun leh a hmanna tur hmun chu a in ang lo
  5. </div> tih a ni

Radio hmangin a ti a

data-toggle="buttons-radio"btn-group-a radio style toggling tur chuan add rawh .

  1. <div class = "btn-group" data-toggle = "buttons-radio" > A chhuahna tur hmun leh a hmanna tur hmun chu a in ang lo
  2. <button type = "button" class = "btn btn-primary" > A veilam </button> a ni
  3. <button type = "button" class = "btn btn-primary" > A laiah </button> a ni
  4. <button type = "button" class = "btn btn-primary" > Dinglam </button> a ni a, a chhuahna tur hmun leh a hmanna tur hmun chu a in ang lo
  5. </div> tih a ni

Hman dan tur

JavaScript hmangin button te chu enable rawh:

  1. $ ( '.nav-tabs' tih chu a ni. button () chu a rawn lang a.

Markup a ni

Data attribute te hi button plugin ah hian a pawimawh ber a ni. Markup chi hrang hrangte chu a hnuaia entirnan code hi en la.

Thil thlan theih a ni

Pakhatmah

Thiltih dan tur

$().button('toggle') tih a ni.

Push state a tidanglam. Button chu a activate tawh angin a lang.

Lu a ti sang a! data-toggleAttribute hmangin button pakhat auto toggling i enable thei bawk.
  1. <button type = "button" class = "btn" data-toggle = "button" > ... </button> tih hi a awmzia a awm lo

$().button('loading') tih a ni.

Button state chu loading ah a set - button a disable a, text chu loading text ah a swap bawk. Loading text chu button element ah data attribute hmangin define tur a ni data-loading-text.

  1. <button type = "button" class = "btn" data-loading-text = "thil phurh chhuah..." > ... </button>
Lu a ti sang a! Firefox hian page load zawng zawngah disabled state chu a persist vek a ni . Chumi atana workaround chu hman autocomplete="off"a ni .

$().button('reset') tih a ni.

Button state a reset - text chu original text ah a inthlak thin.

$().button(string) a ni.

Button state a reset - data defined text state eng pawhah text a swap thin.

  1. <button type = "button" class = "btn" data-complete-text = "a zo tawh!" > ... </button> tih a ni
  2. <script> tih a ni
  3. $ ( '.btn' tih a ni). button ( 'tihfel' ) .
  4. </script> tih a ni

Lam

Accordion leh navigation ang chi collapsible component hrang hrangte tan base style leh flexible support dawng rawh.

* Transitions plugin a tel tur a ni.

Entirnan accordion tih ang chi

Collapse plugin hmangin accordion style widget awlsam tak kan siam a:

A rilru a buai em em a, a rilru a hah em em bawk a, a rilru a buai em em bawk a, a rilru a hah em em bawk a, a rilru a hah em em bawk a. terry richardson ad squid. 3 savawm thla officia aute, non cupidatat skateboard dolor brunch hmanga siam a ni. Chaw phur truck quinoa nesciunt laborum eiusmod. Brunch 3 sava thla tempor, sunt aliqua chuan a chungah sava dah squid single-origin coffee nulla assumenda shoreditch et. A rilru a buai em em a, a rilru a hah em em bawk a, a rilru a buai em em bawk a, a rilru a hah em em bawk a. craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan tih loh chu sa thattu vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt i hre lo mai thei an accusamus labore sustainable VHS.
A rilru a buai em em a, a rilru a hah em em bawk a, a rilru a buai em em bawk a, a rilru a hah em em bawk a, a rilru a hah em em bawk a. terry richardson ad squid. 3 savawm thla officia aute, non cupidatat skateboard dolor brunch hmanga siam a ni. Chaw phur truck quinoa nesciunt laborum eiusmod. Brunch 3 sava thla tempor, sunt aliqua chuan a chungah sava dah squid single-origin coffee nulla assumenda shoreditch et. A rilru a buai em em a, a rilru a hah em em bawk a, a rilru a buai em em bawk a, a rilru a hah em em bawk a. craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan tih loh chu sa thattu vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt i hre lo mai thei an accusamus labore sustainable VHS.
A rilru a buai em em a, a rilru a hah em em bawk a, a rilru a buai em em bawk a, a rilru a hah em em bawk a, a rilru a hah em em bawk a. terry richardson ad squid. 3 savawm thla officia aute, non cupidatat skateboard dolor brunch hmanga siam a ni. Chaw phur truck quinoa nesciunt laborum eiusmod. Brunch 3 sava thla tempor, sunt aliqua chuan a chungah sava dah squid single-origin coffee nulla assumenda shoreditch et. A rilru a buai em em a, a rilru a hah em em bawk a, a rilru a buai em em bawk a, a rilru a hah em em bawk a. craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan tih loh chu sa thattu vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt i hre lo mai thei an accusamus labore sustainable VHS.
  1. <div class = "accordion" id = "accordion2" > tih hi a awmzia a awm lo
  2. <div class = "accordion-pawh" > tih a ni
  3. <div class = "accordion-a thupui" >
  4. <a class = "accordion-toggle" data-toggle = "a tlakbuak" data-parent = "#accordion2" href = "#collapseOne" >
  5. Collapsible Group Item #1. A chhuahna tur hmun leh a hmanna tur hmun
  6. </a> tih a ni
  7. </div> tih a ni
  8. <div id = "collapseOne" class = "accordion- taksa a tlakbuak" >
  9. <div class = "accordion-a chhunga awm" >
  10. Anim pariatur tih hi a dik lo a ni.
  11. </div> tih a ni
  12. </div> tih a ni
  13. </div> tih a ni
  14. <div class = "accordion-pawh" > tih a ni
  15. <div class = "accordion-a thupui" >
  16. <a class = "accordion-toggle" data-toggle = "a tlakbuak" data-parent = "#accordion2" href = "#collapsePahnih" >
  17. Collapsible Group Item #2. A chhuahna tur hmun leh a hmanna tur hmun
  18. </a> tih a ni
  19. </div> tih a ni
  20. <div id = "collapseTwo" class = "accordion-taksa tlakchhiatna" >
  21. <div class = "accordion-a chhunga awm" >
  22. Anim pariatur tih hi a dik lo a ni.
  23. </div> tih a ni
  24. </div> tih a ni
  25. </div> tih a ni
  26. </div> tih a ni
  27. ...

Accordion markup tel lovin plugin hi i hmang thei bawk. Element dang expanding leh collapsing chu button pakhat toggle turin siam rawh.

  1. <button type = "button" class = "btn btn-hlauhawm" data-toggle = "a tlakchhiat" data-target = "#demo" >
  2. simple collapsible a ni
  3. </button> tih a ni
  4.  
  5. <div id = "demo" class = "a tlakbuak" > ... </div>

Hman dan tur

Data attribute hmangin a ni

Add data-toggle="collapse"leh a data-targetto element mai chuan collapsible element control chu automatic in a assign thei ang. Attribute hian data-targetcollapse apply tur css selector a pawm a. collapseCollapsible element ah hian class chu add ngei ngei tur a ni. Default open i duh chuan additional class kha add la in.

Collapsible control-a accordion ang chi group management dah belh tur chuan data attribute data-parent="#selector". Hei hi action-a hmuh theih nan demo en rawh.

JavaScript hmangin

Manual hmangin enable theih a ni:

  1. $ ( ".a tlakbuak" ). a tlakbuak () .

Thil thlan theih a ni

Options chu data attribute emaw JavaScript hmangin pass theih a ni. Data attribute atan chuan option hming chu , ah hian append la data-, data-parent="".

Hming lampang hlawhchhamna hrilhfiahna
nu leh pa selector a ni diklo Selector a nih chuan he collapsible item hi a lan hunah parent tarlan hnuaia collapsible element zawng zawng chu khar vek a ni ang. (acordion tih dan phung pangngai ang chiah)
toggle a ni boolean a ni dik Invocation-ah collapsible element a toggle thin

Thiltih dan tur

.collapse(thil thlan tur) .

I content chu collapsible element angin a activate thin. A pawm a, optional options a awm objectbawk .

  1. $ ( '#kaCollapsible' ). a tlakbuak ({
  2. toggle : dik lo
  3. }) tih a ni.

.collapse('toggle') tih a ni.

Collapsible element chu show emaw hidden emaw ah a toggle thin.

.collapse(' entir') tih a ni.

Collapsible element a lantir.

.collapse('thup') tih a ni.

Collapsible element a thup thei.

Thil thlengte

Bootstrap-a collapse class hian collapse functionality-a hook theihna tur event tlemte a pholang a.

Hunbik Hrilhfiahna
lantir showHe event hi instance method kan koh chuan a fire nghal vek a ni.
tih a ni He event hi collapse element pakhat user hmuh theiha siam a nih chuan fire a ni (css transitions zawh hun a nghak ang).
biru hideHe event hi method a koh zawh chuan a fire nghal a ni.
thuhruk He event hi user hnen atanga collapse element thup a nih chuan a fire thin (css transitions zawh hun a nghak ang).
  1. $ ( '#kaCollapsible' ). on ( 'thup' , hnathawh () { .
  2. // thil engemaw ti rawh...
  3. }) tih a ni.

Entirna

Eng form text input pawha elegant typeaheads rang taka siam theihna tur plugin bulpui, awlsam taka tihzauh theih.

  1. <input type = "text" data-provide = "type hmahruaitu" >

autocomplete="off"Bootstrap typeahead dropdown-a default browser menu a lan loh nan set i duh ang .


Hman dan tur

Data attribute hmangin a ni

A chunga entirnan kan hmuh ang hian typeahead functionality nei element register turin data attribute te dah belh rawh.

JavaScript hmangin

Typeahead chu manual-in ko rawh:

  1. $ ( '.type hmasa ber' ). type hmasa ber () .

Thil thlan theih a ni

Options chu data attribute emaw JavaScript hmangin pass theih a ni. Data attribute atan chuan option hming chu , ah hian append la data-, data-source="".

Hming lampang hlawhchhamna hrilhfiahna
bultanna array, hnathawh dan [ ] a ni. Data source chu zawhna zawh tur a ni. String array emaw function emaw pawh a ni thei. Function hian argument pahnih a pass a, chu querychu input field-a value leh processcallback a ni. processFunction chu callback-a single argument hmangin data source chu direct-a emaw, asynchronous-a emaw return-in synchronous-in hman theih a ni.
thil a zat 8. A ni Dropdown-a thil lang tur max zat.
minLength a ni a zat 1. a ni Autocomplete rawtna trigger hmaa character sei ber mamawh zat
matcher a ni thiltih case insensitive lo tak a ni Query pakhat chu item nen a inmil em tih hriat theihna tur method. Argument pakhat a pawm a, chu itemchu zawhna test tur a ni. Tuna zawhna awm mek chu this.query. trueQuery a inmil chuan boolean a rawn pe leh ang.
sorter a ni thiltih inmil tak,
case sensitive,
case insensitive lo
Autocomplete result sort dan tur hman dan. Argument pakhat a pawm a, itemstypeahead instance scope a nei bawk. Tuna zawhna awm mek chu this.query.
updater a ni thiltih item thlan tawh chu a rawn pe kir leh thin Item thlan tawh rawn thawn let leh dan tur. Argument pakhat a pawm a, the itemand hian typeahead instance scope a nei a.
highlighter a ni thiltih default match zawng zawng a highlight vek Autocomplete result tarlanna atana hman dan. Argument pakhat a pawm a, itemtypeahead instance scope a nei bawk. html a rawn kir leh tur a ni.

Thiltih dan tur

.typeahead(thil thlan theih) .

Input pakhat chu typeahead hmangin a initialize thin.

Entirna

A veilam a subnavigation hi affix plugin live demo a ni.


Hman dan tur

Data attribute hmangin a ni

data-spy="affix"Element eng pawha awlsam taka affix behavior dah tur chuan i spy duh element ah khan add mai tur a ni. Tichuan offset hmangin element pakhat pinning on leh off hun tur chu define rawh.

  1. A rilru a hah lutuk chuan a rilru a buai em em a, a rilru a hah lutuk chuan a rilru a buai em em bawk a . 200 > ... < / div >
Lu a ti sang a! Pinned element awmna leh a nu leh pa hnai ber awm dan tur i enkawl tur a ni. Position chu affix, affix-top, leh affix-bottom. Affix kick in hian page-a normal flow atanga content a paih chhuah avangin nu leh pa collapsed thei tur awm leh awm loh enfiah thin ang che.

JavaScript hmangin

JavaScript hmangin affix plugin chu call rawh:

  1. $ ( '#navbar' tih chu a ni). affix () tih a ni.

Thil thlan theih a ni

Options chu data attribute emaw JavaScript hmangin pass theih a ni. Data attribute atan chuan option hming chu , ah hian append la data-, data-offset-top="200".

Hming lampang hlawhchhamna hrilhfiahna
offset a ni number | hnathawh | thil 10 a ni Scroll awmna tur chhiar hunah screen atanga offset tur pixels te. Number pakhat pek a nih chuan offset chu a chung leh vei lamah a hmang ang. Direction pakhat, a nih loh leh unique offset tam tak ngaihthlak tur chuan object pakhat pe mai offset: { x: 10 }rawh . Offset dynamically pek i mamawh hunah function hmang la (responsive design thenkhat tan a tangkai).