Tisa swiphemu swa Bootstrap evuton’wini—sweswi hi 12 wa ti-plugin ta jQuery leti endleriweke wena.
Ku teka loku olovisiweke, kambe loku cinca-cincaka, eka plugin ya ndhavuko ya modal ya javascript leyi nga na ntsena ntirho wa le hansi lowu lavekaka na swihlawulekisi swo tlhariha.
Engetela timenyu leti nga ehansi eka kwalomu ka xin’wana ni xin’wana eka Bootstrap hi xiengetelo lexi xo olova. Bootstrap yi na nseketelo lowu heleleke wa menyu leyi nga ehansi eka eka navbar, tithebhu, na tiphilisi.
Tirhisa scrollspy ku pfuxeta hi ku tisungulela swihlanganisi eka navbar ya wena ku kombisa xihlanganisi xa sweswi lexi tirhaka hi ku ya hi xiyimo xa ku rhendzeleka.
Tirhisa plugin leyi ku endla leswaku tithebhu na tiphilisi ti pfuna swinene hi ku ti pfumelela ku cinca-cinca hi ku tirhisa tipheji ta tithebhu ta swilo swa laha kaya.
Ku teka lokuntshwa eka jQuery Tipsy plugin, Tooltips a yi titsheganga hi swifaniso—va tirhisa CSS3 eka swifaniso leswi hanyaka na data-attributes eka vuhlayiselo bya swihloko swa laha kaya.
Engetelani swifunengeto leswitsongo swa swilo leswi nga endzeni, ku fana ni leswi nga eka iPad, eka elemente yihi na yihi yo veka rungula ra vumbirhi.
* Swi lava leswaku ku katsiwa Tooltips
Plugin ya xitsundzuxo i tlilasi leyitsongo yo engetela ntirho wa le kusuhi eka switsundzuxo.
Endla swo tala hi swikomba-nkarhi. Vulawuri bya swikomba-nkarhi kumbe ku tumbuluxa mintlawa ya swikomba-nkarhi swa swiphemu swo tala swo fana na tibarhi ta switirhisiwa.
Kuma switayele swa le hansi na nseketelo lowu cinca-cincaka wa swiphemu leswi pfalaka ku fana na ti-accordion na ku famba-famba.
Endla merry-go-round ya swilo swihi na swihi leswi u lavaka ku nyika nkombiso wa swilayidi lowu tirhisanaka wa swilo leswi nga endzeni.
Plugin ya xisekelo, leyi andlariweke hi ku olova yo hatlisa ku tumbuluxa ti-typeahead to saseka hi ku nghenisa tsalwa ra fomo rihi na rihi.
Ku kuma switandzhaku swo olova swa ku cinca, katsa bootstrap-transition.js kan’we ku rhetela eka ti-modal kumbe ku fade out switsundzuxo.
* Swi laveka eka animation eka ti-plugin
Ku teka loku olovisiweke, kambe loku cinca-cincaka, eka plugin ya ndhavuko ya modal ya javascript leyi nga na ntsena ntirho wa le hansi lowu lavekaka na swihlawulekisi swo tlhariha.
Download fayiliLaha hansi ku na modal leyi hundzuluxeriweke hi ndlela leyi nga cinciki.
Miri wun’we lowunene...
Toggle a modal hi ku tirhisa javascript hi ku tikhoma button leyi nga laha hansi. Yi ta rhetela ehansi yi tlhela yi nyamalala ku suka ehenhla ka tluka.
Ku sungula demo modalFonela modal hi ku tirhisa javascript:
- $ ( '#Modal ya mina' ). modal ( swihlawulekisi ) .
Vito | muxaka | ku tlula | nhlamuselo |
---|---|---|---|
xifaniso xa le ndzhaku | xitsonga xitsonga | ntiyiso | Ku katsa na xiaki xa modal-backdrop. Handle ka sweswo, boxa static eka backdrop leyi nga pfaliki modal eka click. |
xikhiya xa xikhiya | xitsonga xitsonga | ntiyiso | Ku pfala modal loko ku tshikileriwa escape key |
kombisa | xitsonga xitsonga | ntiyiso | Ku kombisa modal loko yi sunguriwa. |
U nga tirhisa ti modals eka pheji ya wena hi ku olova handle ko tsala layini yin’we ya javascript. Ntsena veka data-toggle="modal"
eka elemente ya mulawuri leyi nga na data-target="#foo"
kumbe href="#foo"
leyi fambelanaka na id ya elemente ya modal, naswona loko yi tsindziyerile, yi ta sungula modal ya wena.
Nakambe, ku engetela swihlawulekisi eka xikombiso xa wena xa modal, swi katsa ntsena tanihi swihlawulekisi swa data leswi engetelekeke eka xiaki xa vulawuri kumbe ku fungha ka modal hi koxe.
- <a class = "btn" data-toggle = "modal" href = "#Modal ya mina" > Sungula Modal </a>
- <div class = "ku fihla ka xivumbeko" id = "Modal ya mina" >
- <div class = "nhlokomhaka-ya-modal" >
- < muxaka wa buti = "button" class = "pfala" data-dismiss = "modal" > × </button>
- <h3> Nhlokomhaka ya modali </h3>
- </div>
- <div class = "miri-wa-modal" >
- <p> Miri wun’we lowunene... </p>
- </div>
- <div class = "xihlamusela-marito xa xiyimo xa le hansi" >
- <a href = "#" tlilasi = "btn" data-dismiss = "modal" > Pfala </a>
- <a href = "#" class = "btn btn-primary" > Hlayisa ku cinca </a>
- </div>
- </div>
.fade
tlilasi eka
.modal
elemente (languta eka demo ku vona leswi hi xiendlo) ivi u katsa bootstrap-transition.js.
Ku endla leswaku nhundzu ya wena yi tirha tanihi modal. Ku amukela swihlawulekisi swa ku hlawula object
.
- $ ( '#Modal ya mina' ). modal ({
- xikhiya : mavunwa
- }) .
Hi voko u cinca-cinca modal.
- $ ( '#Modal ya mina' ). modal ( 'ku cinca-cinca' ) .
Hi voko u pfula modal.
- $ ( '#Modal ya mina' ). modal ( 'kombisa' ) .
Hi voko u tumbeta modal.
- $ ( '#Modal ya mina' ). modal ( 'fihla' ) .
Tlilasi ya modal ya Bootstrap yi paluxa swiendlakalo swi nga ri swingani swo khoma eka ntirho wa modal.
Nkhuvo | Nhlamuselo |
---|---|
kombisa | Xiendlakalo lexi xi pfurha hi ku hatlisa loko ku show vitaniwa ndlela ya xikombiso. |
ku kombisiwile | Xiendlakalo lexi xi duvuriwa loko modal yi endliwile yi vonaka eka mutirhisi (yi ta rindza ku cinca ka css ku hetisisiwa). |
tumbela | Xiendlakalo lexi xi duvuriwa hi ku hatlisa loko ndlela ya hide xikombiso yi vitaniwile. |
tumbetile | Xiendlakalo lexi xi duvuriwa loko modal yi hetile ku tumbetiwa eka mutirhisi (yi ta rindza ku cinca ka css ku hela). |
- $ ( '#Modal ya mina' ). on ( 'ku fihliwile' , ntirho () {
- // endla swo karhi...
- }) .
Engetela timenyu leti nga ehansi eka kwalomu ka xin’wana ni xin’wana eka Bootstrap hi xiengetelo lexi xo olova. Bootstrap yi na nseketelo lowu heleleke wa menyu leyi nga ehansi eka eka navbar, tithebhu, na tiphilisi.
Download fayiliClick eka ti dropdown nav links eka navbar na tiphilisi leti nga laha hansi ku kambela ti dropdowns.
Fonela swilo leswi nga ehansi hi ku tirhisa javascript:
- $ ( '.ku rhelela-ku cinca-cinca' ). xihlangi lexi nga ehansi () .
Ku hatlisa u engetela ntirho wa dropdown eka element yin’wana na yin’wana engetela ntsena data-toggle="dropdown"
naswona dropdown yihi na yihi ya bootstrap leyi tirhaka yi ta tirhisiwa hi ku tisungulela.
data-target="#fat"
kumbe
href="#fat"
.
- <ul class = "nav nav-tiphilisi" >
- <li class = "active" ><a href = "#" > Xihlanganisi xa nkarhi na nkarhi </a></li>
- <li tlilasi = "xirhendzevutani" id = "menu1" >
- <a class = "ku cinca-cinca-ku-tlhelela ehansi" data-toggle = "ku-tlhelela ehansi" href = "#menu1" >
- Ku rhelela ehansi
- <b tlilasi = "caret" ></b>
- </a>
- <ul class = "menyu leyi nga ehansi" >
- <li><a href = "#" > Xiendlo </a></li>
- <li><a href = "#" > Xiendlo xin'wana </a></li>
- <li><a href = "#" > Xin'wana laha </a></li>
- <li tlilasi = "xihambanisi" </li>
- <li><a href = "#" > Xihlanganisi lexi hambanisiweke </a></li>
- </ul>
- </li>
- ...
- </ul>
Ku hlayisa ti-URL ti nga onhakanga, tirhisa data-target
xihlawulekisi ematshan’weni ya href="#"
.
- <ul class = "nav nav-tiphilisi" >
- <li class = "xirhendzevutani xa le hansi" >
- <a class = "ku cinca-cinca-ku-tlhelela ehansi" data-toggle = "ku-hunguteka" data-target = "#" href = "ndlela/ku ya eka/pheji.html" >
- Ku rhelela ehansi
- <b tlilasi = "caret" ></b>
- </a>
- <ul class = "menyu leyi nga ehansi" >
- ...
- </ul>
- </li>
- </ul>
Api ya programatic yo tirhisa timenyu ta navbar leyi nyikiweke kumbe ku famba-famba loku nga ni tithebhu.
Plugin ya ScrollSpy i ya ku pfuxeta hi ku tisungulela swikongomelo swa nav hi ku ya hi xiyimo xa scroll.
Download fayiliSkrolela ndhawu leyi nga laha hansi ivi u hlalela mpfuxeto wa ku famba-famba. Swilo leswitsongo leswi nga ehansi swi ta kombisiwa na swona. Ringeta ku swi endla!
Ad leggings keytar, brunch id vutshila nkhuvo dolor labore. Pitchfork yr enim lo-fi va nga si xavisa qui. Tumblr timfanelo ta xikanyakanya xa purasi ku ya etafuleni whatever. Anim keffiyeh xitsonga xitsonga xitsonga xitsonga xitsonga. Velit seitan mcsweeney's xifaniso xa xiyindlwana 3 mpfundla n'weti irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui kumbexana a wu se twa hi vona et cardigan nkwama wa vutshembeki culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred xihlekiso biodiesel keffiyeh mutirhi wa mavoko ullamco consequat.
Veniam marfa malebvu ya xikanyakanya, adipisicing fugiat velit malebvu ya pitchfork. Freegan malebvu aliqua cupidat mcsweeney ya vero. Cupidatat mune loko nisi, ea helvetica nulla carles. Tattooed cosby jesi lori swakudya, mcsweeney's quis non freegan vinyl. Lo-fi wes anderson +1 xitsonga xitsonga xitsonga xitsonga xitsonga xitsonga. Carles non aesthetic ku endla vutiolori quis gentrify. Brooklyn adipisicing vutshila bya vutshila bya le xihundleni xa keytar deserunt.
Occaecat commodo xihlala xa xirhendzevutani. Fap vutshila byalwa deserunt xikanyakanya ea. Lomo timfanelo ta xikanyakanya adipisicing banh mi, velit ea sunt xiyimo lexi landzelaka locavore kofi ya masungulo yin’we eka magna veniam. Vutomi bya le henhla id vinyl, echo phaka consequat quis aliquip banh mi pitchfork. Vero VHS est ku hlantswa. Consectetur nisi DIY xikhwama xa murhumiwa lexitsongo. Cred ex eka, delectus consectetur fanny pack iphone leyi nga ta tshama nkarhi wo leha.
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 nkwama wa murhumiwa marfa yini na yini delectus lori ya swakudya. Sapiente synth id ya ku ehleketa. Locavore sed helvetica cliche irony, ti thundercats kumbexana a wu si twa hi tona consequat hoodie gluten-free lo-fi fap aliquip. Labore elit placeat va nga si xavisiwa, terry richardson proident brunch nesciunt quis cosby xisuti pariatur keffiyeh ut helvetica mutirhi wa mavoko. Cardigan craft biya seitan yi lunghekile velit. VHS chambray laboris xitsongwatsongwana xa nkarhinyana. Anim mollit minim commodo ullamco switsongwatsongwana swa ku dzindza ka tilo.
Fonela scrollspy hi ku tirhisa javascript:
- $ ( '#navbar' ). xiphepherhele xa swiphepherhele () .
Ku engetela hi ku olova mahanyelo ya scrollspy eka ku famba-famba ka wena ka topbar, engetela ntsena data-spy="scroll"
eka elemente leyi u lavaka ku yi hlota (hi ntolovelo leswi swi nga va miri).
- <body data-spy = "ku rhendzeleka" > ... </miri>
<a href="#home">home</a>
fanele yi fambisana ni nchumu lowu nga eka dom ku fana na
<div id="home"></div>
.
Loko u tirhisa scrollspy hi ku fambisana na ku engetela kumbe ku susa swiaki eka DOM, u ta lava ku vitana ndlela yo pfuxeta ku fana na sweswo:
- $ ( '[data-spy="ku rhendzeleka"]' ). xin'wana na xin'wana ( ntirho () { .
- var $ nhlori = $ ( leswi ). scrollspy ( 'ku pfuxeta' ) .
- });
Vito | muxaka | ku tlula | nhlamuselo |
---|---|---|---|
offset | nomboro | 10. | Tipikseli to offset kusuka ehenhla loko u hlayela xiyimo xa scroll. |
Nkhuvo | Nhlamuselo |
---|---|
ku tirhisa | Xiendlakalo lexi xi pfurha nkarhi wun’wana ni wun’wana loko nchumu lowuntshwa wu sungula ku tirhisiwa hi scrollspy. |
Plugin leyi yi engetela ku hatlisa, ku cinca-cinca ka thebhu na ntirho wa philisi ku cinca hi ku tirhisa swilo swa laha kaya.
Download fayiliClick ti tabs leti nga laha hansi ku cinca-cinca exikarhi ka ti pane leti fihliweke, hambi ku ri hi ku tirhisa ti dropdown menus.
Raw denim kumbexana a wu se twa hi vona jean shorts Austin. Nesciunt tofu stumptown aliqua, ku basisiwa ka n’wini wa synth ya retro. Xikhovha xa malebvu xa nkarhinyana, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh xitsonga xitsonga xitsonga xitsonga xitsonga xitsonga xitsonga xitsonga xitsonga. Xisuti xa cosby eu banh mi, qui irure terry richardson ex squid. Aliquip placeat xitsonga xitsonga xitsonga xitsonga xitsonga xitsonga. Seitan aliquip quis cardigan swiambalo swa le Amerika, muxavisi wa nyama 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.
Nkwama wa vutshembeki seitan letterpress, keytar raw denim keffiyeh etsy nkhuvo wa vutshila va nga si xavisa master cleanse gluten-free squid scenester freegan cosby jesi. Fanny pack portland seitan DIY, vutshila nkhuvo locavore mpfundla cliche vutomi bya le henhla echo phaka Austin. Cred vinyl keffiyeh DIY salvia PBR, banh mi va nga si xavisa xisuti xa cosby xa VHS lexi nga ni xitsongwatsongwana xa le purasini ku ya etafuleni. Lomo mpfundla viral, malebvu readymade thundercats keffiyeh vutshila byalwa bya mavoko marfa mahanyelo. Mpfundla salvia freegan, sartorial keffiyeh echo phaka ya vegan.
Endla leswaku tithebhu ta tithebhu ti tirha hi ku tirhisa javascript (thebhu yin’wana ni yin’wana yi lava ku tirhisiwa hi yoxe):
- $ ( '#Tab ya mina a' ). click ( ntirho ( e ) { .
- e . sivelaXihlawulekisi ();
- $ ( leswi ). tab ( 'kombisa' );
- }) .
U nga tirhisa tithebhu ha yin’we-yin’we hi tindlela to hlayanyana:
- $ ( '#Tab ya mina a[href="#profayile"]' ). tab ( 'kombisa' ); // Hlawula thebhu hi vito
- $ ( '#Tab ya mina a:yo sungula' ). tab ( 'kombisa' ); // Hlawula thebhu yo sungula
- $ ( '#Tab ya mina a:yo hetelela' ). tab ( 'kombisa' ); // Hlawula thebhu yo hetelela
- $ ( '#Tab ya mina li:eq(2) a' ). tab ( 'kombisa' ); // Hlawula thebhu ya vunharhu (0-indexed) .
U nga tirhisa ku famba-famba ka thebhu kumbe philisi handle ko tsala javascript yihi na yihi hi ku boxa ntsena data-toggle="tab"
kumbe data-toggle="pill"
eka elemente. Ku engetela titlilasi ta na eka thebhu nav
swi ta tirhisa xitayili xa thebhu ya bootstrap.nav-tabs
ul
- <ul tlilasi = "nav nav-tithebhu" >
- <li><a href = "#ekaya" data-toggle = "thebhu" > Ekaya </a></li>
- <li><a href = "#profayile" data-toggle = "thebhu" > Xivumbeko </a></li>
- <li><a href = "#mahungu" data-toggle = "thebhu" > Mahungu </a></li>
- <li><a href = "#swiyimiso" data-toggle = "thebhu" > Switirhisiwa </a></li>
- </ul>
Ku tirhisa xiaki xa thebhu na xigwitsirisi xa nhundzu. Tab yi fanele ku va na a data-target
kumbe ku href
kongomisa eka node ya xikhomela eka DOM.
- <ul class = "nav nav-tithebhu" id = "Tab ya mina" >
- <li class = "active" ><a href = "#kaya" > Ekaya </a></li>
- <li><a href = "#profayile" > Xivumbeko </a></li>
- <li><a href = "#mahungu" > Mahungu </a></li>
- <li><a href = "#swiyimiso" > Switirhisiwa </a></li>
- </ul>
- <div class = "nhundzu ya thebhu" >
- <div class = "thebhu-pheni leyi tirhaka" id = "kaya" > ... </div>
- <div class = "thebhu-pheni" id = "phurofayili" > ... </div>
- <div class = "thebhu-pheni" id = "mahungu" > ... </div>
- <div class = "tab-pane" id = "swiletelo" > ... </div>
- </div>
- <tsalwa>
- $ ( ntirho () { .
- $ ( '#Tab ya mina a:yo hetelela' ). tab ( 'kombisa' );
- }) .
- </script>
Nkhuvo | Nhlamuselo |
---|---|
kombisa | Xiendlakalo lexi xi pfurha eka nkombiso wa thebhu, kambe thebhu leyintshwa yi nga si kombisiwa. Tirhisa event.target na event.relatedTarget ku kongomisa thebhu leyi tirhaka na thebhu leyi tirhaka ya khale (loko yi ri kona) hi ku landzelelana. |
ku kombisiwile | Xiendlakalo lexi xi pfurha eka nkombiso wa thebhu endzhaku ka loko thebhu yi kombisiwile. Tirhisa event.target na event.relatedTarget ku kongomisa thebhu leyi tirhaka na thebhu leyi tirhaka ya khale (loko yi ri kona) hi ku landzelelana. |
- $ ( 'a [ku cinca-cinca ka data="thebhu"]' ). on ( 'ku kombisiwile' , ntirho ( e ) { .
- e . target // thebhu leyi tirhisiweke
- e . relatedTarget // thebhu ya khale
- }) .
Ku hlohloteriwa hi jQuery.tipsy plugin ya kahle swinene leyi tsariweke hi Jason Frame; Switirhisiwa i vuhundzuluxeri lebyi pfuxetiweke, lebyi nga titshegangiki hi swifaniso, byi tirhisa css3 eka swifaniso leswi hanyaka, na data-attributes eka vuhlayiselo bya swihloko swa laha kaya.
Download fayiliHover ehenhla ka swihlanganisi leswi nga laha hansi ku vona switsundzuxo swa switirhisiwa:
Tight pants next level keffiyeh kumbexana a wu se swi twa. Xifaniso xa xivandla xa malebvu ya denim yo ka yi nga swekiwanga letterpress vegan messenger bag stumptown. Seitan ya le purasini ku ya etafuleni, mcsweeney’s fixie sustainable quinoa 8-bit swiambalo swa le Amerika swi na terry richardson vinyl chambray. Beard stumptown, ti-cardigan banh mi lomo ti- thundercat. Tofu biodiesel williamsburg marfa, mune loko mcsweeney ya basisa vegan chambray. A really ironic artisan whatever keytar , scenester purasi-ku-tafula banksy Austin twitter khoma freegan cred raw denim kofi ya masungulo yin’we ya xitsongwatsongwana.
Pfuxeta xitsundzuxo xa xitirhisiwa hi ku tirhisa javascript:
- $ ( '#xikombiso' ). xitsundzuxo xa switirhisiwa ( swihlawulekisi ) .
Vito | muxaka | ku tlula | nhlamuselo |
---|---|---|---|
ku endla swifaniso leswi hanyaka | xitsonga xitsonga | ntiyiso | tirhisa ku cinca ka css fade eka xitirhisiwa |
ku vekiwa ka swilo | ntambhu|ntirho | 'henhla' | ndlela yo veka xitirhisiwa - ehenhla | ehansi | ximatsi | mfanelo |
xihlawulekisi xa swilo | ntambu | vunwa | Loko ku nyikiwile xihlawulekisi, swilo swa xitsundzuxo xa switirhisiwa swi ta nyikiwa swikongomelo leswi boxiweke. |
xirhangi | ntambhu ya xirhendzevutani | ntirho | '' . | nkoka wa xihloko xa xiviri loko thegi ya `title` yi nga ri kona |
gwedla | ntambu | 'hover'. | ndlela leyi xitirhisiwa xi pfuriwaka ha yona - hover | ku kongomisa | manyuwali |
hlwela | nomboro | nchumu | 0. | ku hlwela ku kombisa na ku tumbeta xitsundzuxo xa xitirhisiwa (ms) - a swi tirhi eka muxaka wa xihlohloteri xa manual Loko nomboro yi nyikiwile, ku hlwela ku tirhisiwa eka havumbirhi bya ku fihla/kombisa Xivumbeko xa nchumu i: |
Hi swivangelo swa matirhelo, Tooltip na Popover data-apis swi hlawula ku nghena Loko u lava ku swi tirhisa ntsena boxa nhlawulo wa xihlawulekisi.
- <a href = "#" rel = "xitsundzuxo xa xitirhisiwa" title = "xitsundzuxo xo sungula xa xitirhisiwa" > hover ehenhla ka mina </a>
Ku khomanisa xitirhisiwa xa xitirhisiwa eka nhlengeleto wa swiaki.
Ku paluxa xitsundzuxo xa xitirhisiwa xa elemente.
- $ ( '#xiaki' ). xitsundzuxo xa switirhisiwa ( 'kombisa' ) .
Ku fihla xitsundzuxo xa xitirhisiwa xa elemente.
- $ ( '#xiaki' ). xitsundzuxo xa switirhisiwa ( 'fihla' ) .
Ku cinca-cinca xitsundzuxo xa xitirhisiwa xa elemente.
- $ ( '#xiaki' ). xitsundzuxo xa switirhisiwa ( 'toggle' ) .
Engetelani swifunengeto leswitsongo swa swilo leswi nga endzeni, ku fana ni leswi nga eka iPad, eka elemente yihi na yihi yo veka rungula ra vumbirhi.
* Swi lava leswaku Tooltip yi katsiwa
Download fayiliHover ehenhla ka button ku pfuxa popover.
Endla leswaku ti-popovers ti tirha hi ku tirhisa javascript:
- $ ( '#xikombiso' ). popover ( swihlawulekisi ) .
Vito | muxaka | ku tlula | nhlamuselo |
---|---|---|---|
ku endla swifaniso leswi hanyaka | xitsonga xitsonga | ntiyiso | tirhisa ku cinca ka css fade eka xitirhisiwa |
ku vekiwa ka swilo | ntambhu|ntirho | 'mfanelo' | ndlela yo veka popover - ehenhla | ehansi | ximatsi | mfanelo |
xihlawulekisi xa swilo | ntambu | vunwa | loko ku nyikiwile xihlawulekisi, swilo swa xitsundzuxo xa switirhisiwa swi ta nyikiwa swikongomelo leswi boxiweke |
gwedla | ntambu | 'hover'. | ndlela leyi xitirhisiwa xi pfuriwaka ha yona - hover | ku kongomisa | manyuwali |
xirhangi | ntambhu ya xirhendzevutani | ntirho | '' . | nkoka wa xihloko xa xiviri loko xihlawulekisi xa `title` xi nga ri kona |
vundzeni | ntambhu ya xirhendzevutani | ntirho | '' . | nkoka wa nhundzu ya xiviri loko xihlawulekisi xa `data-content` xi nga ri kona |
hlwela | nomboro | nchumu | 0. | ku hlwela ku kombisa na ku tumbeta popover (ms) - a swi tirhi eka muxaka wa manual trigger Loko nomboro yi nyikiwile, ku hlwela ku tirhisiwa eka havumbirhi bya ku fihla/kombisa Xivumbeko xa nchumu i: |
Hi swivangelo swa matirhelo, Tooltip na Popover data-apis swi hlawula ku nghena Loko u lava ku swi tirhisa ntsena boxa nhlawulo wa xihlawulekisi.
Ku sungula ti-popovers ta nhlengeleto wa swiaki.
Ku paluxa an elements popover.
- $ ( '#xiaki' ). popover ( 'kombisa' ) .
Ku tumbeta an elements popover.
- $ ( '#xiaki' ). popover ( 'fihla' ) .
Ku cinca-cinca ka swiaki swa popover.
- $ ( '#xiaki' ). popover ( 'ku cinca-cinca' ) .
Plugin ya xitsundzuxo i tlilasi leyitsongo yo engetela ntirho wa le kusuhi eka switsundzuxo.
DownlodaPlugin ya switsundzuxo yi tirha eka marungula ya switsundzuxo ya nkarhi na nkarhi, na ku sivela marungula.
Cinca leswi na leswiya ivi u ringeta nakambe. Duis mollis, est non commodo luctus, nisi erat xirho xa xirhendzevutani, xitsongwatsongwana xa xirhendzevutani xa xirhendzevutani. Cras mattis consectetur purus yitshama eka fermentum.
Endla leswaku ku hlongoriwa ka xitsundzuxo ku tirha hi ku tirhisa javascript:
- $ ( ".xitsundzuxo" ). xitsundzuxo () .
Ntsena engetela data-dismiss="alert"
eka buti ya wena yo pfala ku nyika hi ku tisungulela ntirho wa ku pfala wa xitsundzuxo.
- <a class = "pfala" data-dismiss = "xitsundzuxo" href = "#" > &minkarhi; </a>
Pfuxeta switsundzuxo hinkwaswo hi ntirho wa le kusuhi. Ku endla leswaku switsundzuxo swa wena swi hanya loko swi pfariwile, tiyisisa leswaku swi na .fade
na .in
tlilasi leyi se yi tirhisiweke eka swona.
Ku pfala xitsundzuxo.
- $ ( ".xitsundzuxo" ). xitsundzuxo ( 'pfala' ) .
Tlilasi ya xitsundzuxo ya Bootstrap yi paluxa swiendlakalo swi nga ri swingani swo khoma eka ntirho wa xitsundzuxo.
Nkhuvo | Nhlamuselo |
---|---|
pfala | Xiendlakalo lexi xi pfurha hi ku hatlisa loko ku close vitaniwa ndlela ya xikombiso. |
ku pfariwile | Xiendlakalo lexi xi pfuriwa loko xitsundzuxo xi pfariwile (xi ta rindza ku cinca ka css ku hela). |
- $ ( '#xitsundzuxo xa mina' ). bind ( 'ku pfariwile' , ntirho () {
- // endla swo karhi...
- }) .
Kuma switayele swa le hansi na nseketelo lowu cinca-cincaka wa swiphemu leswi pfalaka ku fana na ti-accordion na ku famba-famba.
Download fayili* Swi lava leswaku ku katsiwa plugin ya Transitions.
Hi ku tirhisa plugin ya collapse, hi ake xitirhisiwa xo olova xa xitayili xa accordion:
Endla leswaku swi tirha hi ku tirhisa javascript:
- $ ( ".ku tshoveka" ). ku wa () .
Vito | muxaka | ku tlula | nhlamuselo |
---|---|---|---|
mutswari | xihlawulekisi xa swilo | vunwa | Loko selector kutani swiaki hinkwaswo leswi pfaleriwaka ehansi ka mutswari loyi a boxiweke swi ta pfala loko nchumu lowu wu pfaleriwaka wu kombisiwa. (ku fana ni mahanyelo ya ndhavuko ya accordion) . |
ku cinca-cinca | xitsonga xitsonga | ntiyiso | Ku cinca-cinca xiaki lexi nga pfaleriwaka eka ku vitaniwa |
Ntsena engetela data-toggle="collapse"
na a data-target
eka elemente ku avela hi ku tisungulela vulawuri bya elemente leyi nga pfaleriwaka. Xihlawulekisi data-target
xi amukela xihlawulekisi xa css ku tirhisa ku wisa eka xona. Tiyiseka leswaku u engetela tlilasi collapse
eka xiaki lexi nga pfaleriwaka. Loko u lava leswaku yi pfuleka hi ku tiyimisela, engetela tlilasi leyi engetelekeke in
.
- <button class = "btn btn-khombo" data-toggle = "ku wa" data-xikongomiso = "#demo" >
- ku olova loku pfotlosaka
- </button>
- <div id = "demo" class = "ku wa eka" > ... </div>
data-parent="#selector"
. Languta eka demo ku vona leswi swi ri karhi swi tirha.
Ku endla leswaku nhundzu ya wena yi tirha tanihi xiaki lexi nga pfaleriwaka. Ku amukela swihlawulekisi swa ku hlawula object
.
- $ ( '#swi nga pfaleriwa hi mina' ). ku wa ({
- toggle : mavunwa
- }) .
Ku cinca-cinca xiaki lexi nga pfaleriwaka ku ya eka lexi kombisiweke kumbe lexi fihliweke.
Ku kombisa xiaki lexi nga tshovekaka.
Ku tumbeta xiaki lexi nga tshovekaka.
Tlilasi ya ku wa ya Bootstrap yi paluxa swiendlakalo swi nga ri swingani swo khoma eka ntirho wa ku wa.
Nkhuvo | Nhlamuselo |
---|---|
kombisa | Xiendlakalo lexi xi pfurha hi ku hatlisa loko ku show vitaniwa ndlela ya xikombiso. |
ku kombisiwile | Xiendlakalo lexi xi duvuriwa loko xiaki xa ku wa xi endliwile xi vonaka eka mutirhisi (xi ta rindza ku cinca ka css ku hetisisiwa). |
tumbela | Xiendlakalo lexi xi duvuriwa hi ku hatlisa loko hide ndlela yi vitaniwile. |
tumbetile | Xiendlakalo lexi xi duvuriwa loko elemente ya collapse yi fihliwile eka mutirhisi (yi ta rindza ku cinca ka css ku hetisisiwa). |
- $ ( '#swi nga pfaleriwa hi mina' ). on ( 'ku fihliwile' , ntirho () {
- // endla swo karhi...
- }) .
Plugin ya xivumbeko xa le henhla ya ku rhendzeleka hi swiaki. Xiendlakalo xo tsakisa.
Download fayiliLanguta nkombiso wa swilayidi laha hansi.
Fonela hi ku tirhisa javascript:
- $ ( '.xirhendzevutani' ). xibalesa xa xirhendzevutani () .
Vito | muxaka | ku tlula | nhlamuselo |
---|---|---|---|
nkarhi wo leha | nomboro | 5000 wa vanhu | Nkarhi wo hlwela exikarhi ka ku rhendzeleka ka nchumu wo karhi hi ku tisungulela. Loko ku ri mavunwa, carousel a yi nge tifambi hi yoxe. |
yimanyana | ntambu | "hover" . | Yi yimisa ku rhendzeleka ka carousel eka mouseenter ivi yi tlhela yi sungula ku rhendzeleka ka carousel eka mouseleave. |
Swihlawulekisi swa datha swi tirhisiwa eka ti-conrol leti hundzeke na leti landzelaka. Languta xikombiso xa markup laha hansi.
- <div id = "Carousel ya mina" class = "xilayidi xa carousel" >
- <!-- Swilo swa carousel -->
- <div class = "xirhendzevutani xa carousel" >
- <div class = "nchumu lowu tirhaka" > ... </div>
- <div tlilasi = "nchumu" > ... </div>
- <div tlilasi = "nchumu" > ... </div>
- </div>
- <!-- Xibalesa xa xirhendzevutani nav -->
- <a class = "carousel-vulawuri bya ximatsi" href = "#Carousel ya mina" data-slide = "prev" > ‹ </a>
- <a class = "xinene xa vulawuri bya carousel" href = "#Carousel ya mina" data-slide = "leyi landzelaka" > › </a>
- </div>
Ku sungula carousel hi swihlawulekisi swo hlawula object
ivi a sungula ku khandziya xikanyakanya hi swilo.
- $ ( '.xirhendzevutani' ). xibalesa xa xirhendzevutani ({
- nkarhi wo leha : 2000
- }) .
Ku rhendzeleka hi swilo swa carousel ku suka eximatsini ku ya exineneni.
Swi yimisa carousel ku famba hi xikanyakanya hi swilo.
Yi rhendzeleka na carousel eka furemu yo karhi (0 based, ku fana na array).
Swirhendzevutana ku ya eka nchumu lowu hundzeke.
Swirhendzevutana swi ya eka nchumu lowu landzelaka.
Tlilasi ya carousel ya Bootstrap yi paluxa swiendlakalo swimbirhi swo khoma eka ntirho wa carousel.
Nkhuvo | Nhlamuselo |
---|---|
rheta | Xiendlakalo lexi xi pfurha hi ku hatlisa loko ku slide vitaniwa ndlela ya xikombiso. |
ku rhetela | Xiendlakalo lexi xi duvuriwa loko carousel yi hetile ku cinca ka yona ka swilayidi. |
Plugin ya xisekelo, leyi andlariweke hi ku olova yo hatlisa ku tumbuluxa ti-typeahead to saseka hi ku nghenisa tsalwa ra fomo rihi na rihi.
Download fayiliSungula ku thayipa eka nsimu leyi nga laha hansi ku kombisa mbuyelo wa typeahead.
Fonela typeahead hi ku tirhisa javascript:
- $ ( '.ku thayipa emahlweni' ). ku thayipa emahlweni () .
Vito | muxaka | ku tlula | nhlamuselo |
---|---|---|---|
xihlovo | array ya xirhendzevutani | [ ] . | Xihlovo xa data xo vutisa ku lwisana na xona. |
swilo | nomboro | 8. | Nhlayo ya max ya swilo leswi nga ta kombisiwa eka dropdown. |
muhlanganisi wa swilo | ntirho | ku nga ri na vuxiyaxiya eka maletere lamakulu | Ndlela leyi tirhisiwaka ku kumisisa loko xivutiso xi fambisana ni nchumu wo karhi. Amukela njhekanjhekisano wun’we, item lowu ku nga ta ringeta xivutiso ku lwisana na wona. Fikelela xivutiso xa sweswi hi this.query . Vuyisa boolean true loko xivutiso xi ri ku fambisana. |
muhleri wa swilo | ntirho | ku fambisana loku kongomeke, ku va ni maletere lamakulu, ku nga ri na maletere lamakulu |
Ndlela leyi tirhisiwaka ku hlela mimbuyelo ya autocomplete. Amukela njhekanjhekisano wun’we items naswona yi na xikalo xa xikombiso xa typeahead. Kombetela xivutiso xa sweswi hi this.query . |
xihlawulekisi xa swilo | ntirho | yi kombisa ku fambisana hinkwako ka ntolovelo | Ndlela leyi tirhisiwaka ku kombisa mimbuyelo ya autocomplete. Amukela njhekanjhekisano wun’we item naswona yi na xikalo xa xikombiso xa typeahead. Swi fanele ku vuyisa html. |
Engetela swihlawulekisi swa datha ku tsarisa elemente leyi nga na ntirho wa typeahead.
- < muxaka wa ku nghenisa = "tsalwa" data-provide = "typeahead" >
Ku sungula ku nghenisa hi typeahead.