Tisa swiphemu swa Bootstrap evuton’wini—sweswi hi 13 wa ti-plugin ta jQuery leti endleriweke wena.
Tiplagi ti nga katsiwa hi toxe (hambi leswi tin’wana ti nga na ku titshega loku lavekaka), kumbe hinkwato hi nkarhi wun’we. Havumbirhi bya bootstrap.js na bootstrap.min.js swi na ti-plugin hinkwato eka fayili yin’we.
U nga tirhisa ti-plugin hinkwato ta Bootstrap ntsena hi ku tirhisa API ya markup handle ko tsala layini yin’we ya JavaScript. Leyi i API ya xiyimo xo sungula ya Bootstrap naswona yi fanele ku va ku ri ku tekela enhlokweni ka wena ko sungula loko u tirhisa plugin.
Loko swi vuriwa sweswo, eka swiyimo swin’wana swi nga ha navela ku tima ntirho lowu. Hikwalaho, hi tlhela hi nyika vuswikoti byo tshikisa API ya xihlawulekisi xa data hi ku susa swiendlakalo hinkwaswo eka miri namespaced hi `'data-api'`. Leswi swi languteka hi ndlela leyi:
- $ ( 'miri' ). ku tima ( '.data-api' ) .
Handle ka sweswo, ku kongomisa eka xiengetelo xo karhi, katsa ntsena vito ra xiengetelo tanihi ndhawu ya mavito swin’we ni ndhawu ya mavito ya data-api yo fana ni leyi:
- $ ( 'miri' ). off ( '.xitsundzuxo.data-api' ) .
Hi tlhela hi tshemba leswaku u fanele ku kota ku tirhisa ti-plugin hinkwato ta Bootstrap ntsena hi ku tirhisa JavaScript API. Ti-API hinkwato ta mani na mani i tindlela tin’we, leti nga ni tinketana, naswona ti vuyisa nhlengeleto lowu endliweke hi wona.
- $ ( ".btn.khombo" ). button ( "ku cinca-cinca" ). addClass ( "mafurha" ) .
Maendlelo hinkwawo ya fanele ku amukela nchumu wa swihlawulekisi swa ku hlawula, ntambhu leyi kongomisaka eka ndlela yo karhi, kumbe ku nga ri na nchumu (leyi sungulaka xiengetelo hi mahanyelo ya xiviri):
- $ ( "#Modal ya mina" ). modal () // yi sunguriwile hi swihlawulekisi
- $ ( "#Modal ya mina" ). modal ({ keyboard : false }) // yi sunguriwile ku nga ri na khibhodi
- $ ( "#Modal ya mina" ). modal ( 'show' ) // yi sungula no vitana nkombiso hi ku hatlisa
Plugin yin'wana na yin'wana yi tlhela yi paluxa muaki wa yona wo ka wu nga swekiwanga eka nhundzu ya `Muaki`: $.fn.popover.Constructor
. Loko u lava ku kuma xikombiso xo karhi xa plugin, xi vuyise hi ku kongoma eka elemente: $('[rel=popover]').data('popover')
.
Minkarhi yin’wana swa laveka ku tirhisa ti-plugin ta Bootstrap ni swivumbeko swin’wana swa UI. Eka swiyimo leswi, ku tlumbana ka ndhawu ya mavito ku nga humelela nkarhi wun’wana. Loko leswi swi humelela, u nga ha vitana .noConflict
eka plugin leyi u lavaka ku tlherisela nkoka wa yona.
- var bootstrapXikomba-nkarhi = $ . fn . xikomba -nkarhi xa . noConflict () // vuyisa $.fn.button eka ntikelo lowu averiweke khale
- $ . fn . bootstrapBtn = bootstrapButton // nyika $().bootstrapBtn ntirho wa bootstrap
Bootstrap yi nyika swiendlakalo swa ntolovelo eka swiendlo swo tala swo hlawuleka swa plugin. Hi ntolovelo, leswi swi ta hi xivumbeko xa xiendliwa lexi nga heriki na xiendliwa lexi hundzeke - laha xiendliwa lexi nga heriki (ex. show
) xi pfuriwaka eku sunguleni ka xiendlakalo, naswona xivumbeko xa xona xa xiendliwa lexi hundzeke (ex. shown
) xi hlohloteriwa loko xiendlo xi hetisisiwa.
Swiendlakalo hinkwaswo swa infinitive swi nyika ntirho wa preventDefault. Leswi swi nyika vuswikoti byo yimisa ku hetisisiwa ka xiendlo xi nga si sungula.
- $ ( '#Modal ya mina' ). on ( 'kombisa' , ntirho ( e ) {
- loko (! data ) vuyisa e . preventDefault () // yi yimisa modal ku kombisiwa
- }) .
Ku kuma switandzhaku swo olova swa ku cinca, katsa bootstrap-transition.js kan’we etlhelo ka tifayela tin’wana ta JS. Loko u tirhisa bootstrap.js leyi hlengeletiweke (kumbe leyi hungutiweke) , a ku na xilaveko xo katsa leswi—se swi kona.
Swikombiso swi nga ri swingani swa xiengetelo xa ku cinca:
Timodali ti olovisiwile, kambe ti cinca-cinca, switsundzuxo swa mbulavurisano leswi nga na ntirho wa le hansi lowu lavekaka na swihlawulekisi swo tlhariha.
Modal leyi humesiweke leyi nga na nhlokomhaka, miri, na sete ya swiendlo eka xiphemu xa le hansi.
Miri wun’we lowunene...
- <div class = "ku nyamalala ka ku fihla ka modal" >
- <div class = "nhlokomhaka-ya-modal" >
- < muxaka wa buti = "button" class = "pfala" data-dismiss = "modal" aria-hidden = "ntiyiso" > &minkarhi; </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" > Pfala </a>
- <a href = "#" class = "btn btn-primary" > Hlayisa ku cinca </a>
- </div>
- </div>
Cinca modal hi ku tirhisa JavaScript hi ku tikhoma buti leyi nga laha hansi. Yi ta rhetela ehansi yi tlhela yi nyamalala ku suka ehenhla ka tluka.
- <!-- Batani yo pfuxa modal -->
- <a href = "#myModal" role = "button" class = "btn" data-toggle = "modal" > Sungula xivumbeko xa demo </a>
- <!-- Modal -->
- <div id = "myModal" class = "modal hide fade" tabindex = "-1" xiphemu = "mbulavurisano" aria-labelledby = "myModalLabel" aria-hidden = "ntiyiso" >
- <div class = "nhlokomhaka-ya-modal" >
- < muxaka wa buti = "button" class = "pfala" data-dismiss = "modal" aria-hidden = "ntiyiso" > × </button>
- <h3 id = "myModalLabel" > Nhlokomhaka ya xivumbeko </h3>
- </div>
- <div class = "miri-wa-modal" >
- <p> Miri wun’we lowunene... </p>
- </div>
- <div class = "xihlamusela-marito xa xiyimo xa le hansi" >
- <button class = "btn" data-dismiss = "modal" aria-hidden = "ntiyiso" > Pfala </button>
- <button class = "btn btn-primary" > Hlayisa ku cinca </button>
- </div>
- </div>
Endla leswaku modal yi tirha handle ko tsala JavaScript. Seta data-toggle="modal"
eka elemente ya controller, ku fana na button, xikan’we na a data-target="#foo"
kumbe href="#foo"
ku kongomisa modal yo karhi ku toggle.
- < muxaka wa buti = "buti" data-toggle = "modal" data-target = "#myModal" > Sungula modal </button>
Fonela modal hi id myModal
hi layini yin’we ya JavaScript:
- $ ( '#Modal ya mina' ). modal ( swihlawulekisi ) .
Swihlawulekisi swi nga hundzisiwa hi ku tirhisa swihlawulekisi swa data kumbe JavaScript. Eka swihlawulekisi swa datha, engetela vito ra xihlawuhlawu eka data-
, tanihi le ka data-backdrop=""
.
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. |
kule | ndlela | vunwa | Loko url ya le kule yi nyikiwile, nhundzu yi ta layicha hi ku tirhisa
|
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 hi xiengetelo lexi xo olova, ku katsa ni navbar, tithebhu ni tiphilisi.
Engetela data-toggle="dropdown"
eka link kumbe button ku cinca-cinca dropdown.
- <div class = "xirhendzevutani xa le hansi" >
- <a class = "dropdown-toggle" data-toggle = "ku rhelela" href = "#" > Xihlohloteri xa ku wisa </a>
- <ul class = "menyu leyi nga ehansi" role = "menyu" aria-labelledby = "dLabel" >
- ...
- </ul>
- </div>
Ku hlayisa ti-URL ti nga onhakanga, tirhisa data-target
xihlawulekisi ematshan’weni ya href="#"
.
- <div class = "xirhendzevutani xa le hansi" >
- <a class = "ku cinca-cinca-ku-tlhelela ehansi" id = "dLabel" role = "button" ku cinca-cinca ka data = "ku-hlayisa-ku-hlayisa" data-target = "#" href = "/page.html" >
- Ku rhelela ehansi
- <b tlilasi = "caret" ></b>
- </a>
- <ul class = "menyu leyi nga ehansi" role = "menyu" aria-labelledby = "dLabel" >
- ...
- </ul>
- </div>
Fonela swilo leswi nga ehansi hi ku tirhisa JavaScript:
- $ ( '.ku rhelela-ku cinca-cinca' ). xihlangi lexi nga ehansi () .
Hava
Api ya phurogireme yo cinca-cinca 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. Skrolela ndhawu leyi nga ehansi ka navbar ivi u hlalela ku cinca ka tlilasi leyi tirhaka. Swilo leswitsongo leswi nga ehansi swi ta kombisiwa na swona.
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.
Ku engetela hi ku olova mahanyelo ya scrollspy eka ku famba ka wena ka topbar, engetela ntsena data-spy="scroll"
eka elemente leyi u lavaka ku yi hlota (hi ntolovelo leyi yi ta va miri) na data-target=".navbar"
ku hlawula leswaku u ta tirhisa nav yihi. U ta lava ku tirhisa scrollspy na .nav
xiphemu.
- <miri data-spy = "ku rhendzeleka" data-xikongomelo = ".navbar" > ... </miri>
Fonela scrollspy hi ku tirhisa JavaScript:
- $ ( '#navbar' ). xiphepherhele xa swiphepherhele () .
<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' ) .
- });
Swihlawulekisi swi nga hundzisiwa hi ku tirhisa swihlawulekisi swa data kumbe JavaScript. Eka swihlawulekisi swa datha, engetela vito ra xihlawuhlawu eka data-
, tanihi le ka data-offset=""
.
Vito | muxaka | ku tlula | nhlamuselo |
---|---|---|---|
offset | nomboro | 10. | Tipikseli to offset kusuka ehenhla loko u hlayela xiyimo xa scroll. |
Nkhuvo | Nhlamuselo |
---|---|
ku endla leswaku swi tirha | Xiendlakalo lexi xi pfurha nkarhi wun’wana ni wun’wana loko nchumu lowuntshwa wu sungula ku tirhisiwa hi scrollspy. |
Engetela ntirho wa thebhu wa xihatla, lowu cinca-cincaka ku cinca hi ku tirhisa tipheni ta swilo swa laha kaya, hambi ku ri hi ku tirhisa timenyu leti nga ehansi.
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.
Trust fund seitan letterpress, keytar raw denim keffiyeh etsy art party before they sold out master cleanse gluten-free squid scenester freegan cosby sweater. Fanny pack portland seitan DIY, art party locavore wolf cliche high life echo park Austin. Cred vinyl keffiyeh DIY salvia PBR, banh mi before they sold out farm-to-table VHS viral locavore cosby sweater. Lomo wolf viral, mustache readymade thundercats keffiyeh craft beer marfa ethical. Wolf salvia freegan, sartorial keffiyeh echo park vegan.
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.
Hi swivangelo swa matirhelo, xitirhisiwa na popover data-apis i opt in, leswi vulaka leswaku u fanele ku swi sungula hi wexe .
Hover 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 purasi kuya etafuleni, mcsweeney’s fixie sustainable quinoa 8-bit swiambalo swale american swina terry richardson vinyl chambray. Xihlahla xa malebvu, 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.
Loko u tirhisa switsundzuxo swa switirhisiwa na ti-popover na mintlawa ya ku nghenisa ya Bootstrap, u ta boheka ku veka container
(leyi tsariweke laha hansi) nhlawulo ku papalata switandzhaku leswi nga laviwiki.
Pfuxeta xitsundzuxo xa xitirhisiwa hi ku tirhisa JavaScript:
- $ ( '#xikombiso' ). xitsundzuxo xa switirhisiwa ( swihlawulekisi ) .
Swihlawulekisi swi nga hundzisiwa hi ku tirhisa swihlawulekisi swa data kumbe JavaScript. Eka swihlawulekisi swa datha, engetela vito ra xihlawuhlawu eka data-
, tanihi le ka data-animation=""
.
Vito | muxaka | ku tlula | nhlamuselo |
---|---|---|---|
ku endla swifaniso leswi hanyaka | xitsonga xitsonga | ntiyiso | tirhisa ku cinca ka css fade eka xitirhisiwa |
html | xitsonga xitsonga | vunwa | Nghenisa html eka xitirhisiwa. Loko ku ri mavunwa, ndlela ya jquery text yi ta tirhisiwa ku nghenisa nhundzu eka dom. Tirhisa tsalwa loko u vilerisiwa hi nhlaselo wa XSS. |
ku vekiwa ka swilo | ntambhu ya xirhendzevutani | 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 focus'. | ndlela leyi xitirhisiwa xi pfuriwaka ha yona - tinya | hover | ku kongomisa | manyuwali. Xiya wena case pass trigger mutliple, ndhawu leyi hambanisiweke, tinxaka ta trigger. |
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: |
xigwitsirisi | ntambhu ya xirhendzevutani | vunwa | vunwa | Ku engetela xitsundzuxo xa xitirhisiwa eka elemente yo karhi |
- <a href = "#" data-toggle = "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' ) .
Ku tumbeta no herisa xitirhisiwa xa elemente.
- $ ( '#xiaki' ). tooltip ( 'ku herisa' ) .
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. Hover ehenhla ka button ku pfuxa popover. Swi lava leswaku Tooltip yi katsiwa.
Ku ni swilo swa mune leswi u nga swi hlawulaka: leswi ringanisiweke ehenhla, exineneni, ehansi ni le ximatsi.
Sed posuere consectetur est eka xiyimo xa le henhla. Aenean eu leo quam. Ku khavisiwa ka pellentesque sem lacinia quam venenatis vestibulum.
Sed posuere consectetur est eka xiyimo xa le henhla. Aenean eu leo quam. Ku khavisiwa ka pellentesque sem lacinia quam venenatis vestibulum.
Sed posuere consectetur est eka xiyimo xa le henhla. Aenean eu leo quam. Ku khavisiwa ka pellentesque sem lacinia quam venenatis vestibulum.
Sed posuere consectetur est eka xiyimo xa le henhla. Aenean eu leo quam. Ku khavisiwa ka pellentesque sem lacinia quam venenatis vestibulum.
Ku hava markup leyi kombisiweke tanihi ti-popover leti endliweke ku suka eka JavaScript na nhundzu endzeni ka data
xihlawulekisi.
Endla leswaku ti-popovers ti tirha hi ku tirhisa JavaScript:
- $ ( '#xikombiso' ). popover ( swihlawulekisi ) .
Swihlawulekisi swi nga hundzisiwa hi ku tirhisa swihlawulekisi swa data kumbe JavaScript. Eka swihlawulekisi swa datha, engetela vito ra xihlawuhlawu eka data-
, tanihi le ka data-animation=""
.
Vito | muxaka | ku tlula | nhlamuselo |
---|---|---|---|
ku endla swifaniso leswi hanyaka | xitsonga xitsonga | ntiyiso | tirhisa ku cinca ka css fade eka xitirhisiwa |
html | xitsonga xitsonga | vunwa | Nghenisa html eka popover. Loko ku ri mavunwa, ndlela ya jquery text yi ta tirhisiwa ku nghenisa nhundzu eka dom. Tirhisa tsalwa loko u vilerisiwa hi nhlaselo wa XSS. |
ku vekiwa ka swilo | ntambhu ya xirhendzevutani | 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 | 'click'. | ndlela leyi popover yi pfuriwaka ha yona - click | 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: |
xigwitsirisi | ntambhu ya xirhendzevutani | vunwa | vunwa | Ku engetela popover eka elemente yo karhi |
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' ) .
Ku tumbeta no herisa popover ya element.
- $ ( '#xiaki' ). popover ( 'ku herisa' ) .
Engetela ntirho wo hlongola eka marungula hinkwawo ya xitsundzuxo hi xiengetelo lexi.
Cinca leswi na leswiya ivi u ringeta nakambe. Duis mollis, est non commodo luctus, nisi erat xirhangiso xa xirhendzevutani, xitsonga xitsonga xitsonga xitsonga xitsonga xitsonga xitsonga xitsonga xitsonga. 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.
* Swi lava leswaku ku katsiwa plugin ya Transitions.
Hi ku tirhisa plugin ya collapse, hi ake xitirhisiwa xo olova xa xitayili xa accordion:
- <div class = "akhodiyoni" id = "akhodiyoni2" >
- <div class = "ntlawa-wa-accordion" >
- <div class = "nhlokomhaka ya accordion" >
- <a class = "accordion-toggle" data-toggle = "ku wisa" mutswari wa data = "#akhodiyoni2" href = "#ku wisaYin'we" >
- Nchumu wa Ntlawa lowu Pfuxetiwaka #1
- </a>
- </div>
- <div id = "collapseOne" class = "ku wa ka miri wa accordion eka" >
- <div class = "akhodiyoni-ya le ndzeni" >
- Anim pariatur xitsonga xitsonga...
- </div>
- </div>
- </div>
- <div class = "ntlawa-wa-accordion" >
- <div class = "nhlokomhaka ya accordion" >
- <a class = "accordion-toggle" data-toggle = "ku wisa" mutswari wa data = "#akhodiyoni2" href = "#ku wisaTwo" >
- Nchumu wa Ntlawa lowu Pfuxetiwaka #2
- </a>
- </div>
- <div id = "collapseTwo" class = "ku wa ka miri wa accordion" >
- <div class = "akhodiyoni-ya le ndzeni" >
- Anim pariatur xitsonga xitsonga...
- </div>
- </div>
- </div>
- </div>
- ...
U nga ha tlhela u tirhisa plugin handle ka xikombiso xa accordion. Endla leswaku buti yi cinca-cinca ku andlala ni ku wa ka elemente yin’wana.
- < muxaka wa buti = "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>
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
.
Ku engetela vulawuri bya ntlawa byo fana na accordion eka vulawuri lebyi pfalekaka, engetela xihlawulekisi xa data data-parent="#selector"
. Languta eka demo ku vona leswi swi ri karhi swi tirha.
Endla leswaku swi tirha hi voko hi:
- $ ( ".ku tshoveka" ). ku wa () .
Swihlawulekisi swi nga hundzisiwa hi ku tirhisa swihlawulekisi swa data kumbe JavaScript. Eka swihlawulekisi swa datha, engetela vito ra xihlawuhlawu eka data-
, tanihi le ka data-parent=""
.
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 |
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 xiaki xa ku wa xi fihliwile eka mutirhisi (xi ta rindza ku cinca ka css ku hetisisiwa). |
- $ ( '#swi nga pfaleriwa hi mina' ). on ( 'ku fihliwile' , ntirho () {
- // endla swo karhi...
- }) .
Nkombiso wa swilayidi lowu nga laha hansi wu kombisa plugin ya xivumbeko xa le henhla na xiphemu xo rhendzeleka hi swiaki swo fana na carousel.
- <div id = "Carousel ya mina" class = "xilayidi xa carousel" >
- <ol class = "swikombiso swa carousel" >
- <li data-target = "#myCarousel" data-slide-to = "0" tlilasi = "ntirho" ></li>
- <li data-target = "#Carousel ya mina" xilayidi xa data-ku ya eka = "1" ></li>
- <li data-target = "#Carousel ya mina" xilayidi xa data-ku ya eka = "2" ></li>
- </ol>
- <!-- 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>
Tirhisa swihlawulekisi swa data ku lawula hi ku olova xiyimo xa carousel. data-slide
amukela marito ya nkoka prev
kumbe next
, leswi cincaka xiyimo xa xilayidi loko xi pimanisiwa na xiyimo xa xona xa sweswi. Hi ndlela yin’wana, tirhisa data-slide-to
ku hundzisela xikombo xa swilayidi lexi nga si swekiwaka eka carousel data-slide-to="2"
, lexi jump’s xiyimo xa xilayidi ku ya eka xikombo xo karhi lexi sungulaka hi 0
.
Fonela carousel hi voko hi:
- $ ( '.xirhendzevutani' ). xibalesa xa xirhendzevutani () .
Swihlawulekisi swi nga hundzisiwa hi ku tirhisa swihlawulekisi swa data kumbe JavaScriptz. Eka swihlawulekisi swa datha, engetela vito ra xihlawuhlawu eka data-
, tanihi le ka data-interval=""
.
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. |
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.
Ku rhendzeleka ka carousel ku ya eka furemu yo karhi (0 leyi sekeriweke, ku fana na array).
Swirhendzevutana ku ya eka nchumu lowu hundzeke.
Swirhendzevutana ku 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.
- < muxaka wa ku nghenisa = "tsalwa" data-provide = "typeahead" >
U ta lava ku veka autocomplete="off"
ku sivela timenyu ta xihlamusela-marito xa xiviri ku humelela ehenhla ka Bootstrap typeahead dropdown.
Engetela swihlawulekisi swa datha ku tsarisa elemente leyi nga na ntirho wa typeahead tanihilaha swi kombisiweke hakona eka xikombiso lexi nga laha henhla.
Fonela typeahead hi voko hi:
- $ ( '.ku thayipa emahlweni' ). ku thayipa emahlweni () .
Swihlawulekisi swi nga hundzisiwa hi ku tirhisa swihlawulekisi swa data kumbe JavaScript. Eka swihlawulekisi swa datha, engetela vito ra xihlawuhlawu eka data-
, tanihi le ka data-source=""
.
Vito | muxaka | ku tlula | nhlamuselo |
---|---|---|---|
xihlovo | array, ntirho | [ ] . | Xihlovo xa data xo vutisa ku lwisana na xona. Ku nga ha va ku ri nxaxamelo wa tintambhu kumbe ntirho. Ntirho wu hundzisiwa ti arguments timbirhi, query value eka input field na process callback. Ntirho wu nga tirhisiwa hi ku fambisana hi ku tlherisela xihlovo xa datha hi ku kongoma kumbe hi ku nga fambisani hi ku tirhisa process argument yin’we ya callback. |
swilo | nomboro | 8. | Nhlayo ya max ya swilo leswi nga ta kombisiwa eka dropdown. |
minKu leha | nomboro | 1. | Ku leha ka ximunhuhatwa xa le hansi loku lavekaka ku nga si sungula swiringanyeto swa autocomplete |
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 . |
mupfuxeti wa swilo | ntirho | yi vuyisa nchumu lowu hlawuriweke | Ndlela leyi tirhisiwaka ku tlherisela nchumu lowu hlawuriweke. Amukela njhekanjhekisano wun’we, the item na yi na xikalo xa xikombiso xa typeahead. |
xihlawulekisi xa swilo | ntirho | yi kombisa ku fambisana hinkwako ka xiviri | 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. |
Ku sungula ku nghenisa hi typeahead.
Ku famba-famba loku nga eximatsini i demo leyi hanyaka ya xiengetelo xa xiengetelo.
Ku engetela mahanyelo ya affix hi ku olova eka elemente yihi na yihi, engetela ntsena data-spy="affix"
eka elemente leyi u lavaka ku yi hlota. Kutani tirhisa ti-offset ku hlamusela leswaku u fanele u cinca rini ku pfula ni ku tima ku pini ka elemente.
- <div data-spy = "xiengetelo" data-offset-ehenhla = "200" > ... </div>
affix
,
affix-top
, na
affix-bottom
. Tsundzuka ku kambela mutswari loyi a nga ha tshovekaka loko xiengetelo xi nghena tanihi leswi xi susaka nhundzu eka ku khuluka ka ntolovelo ka tluka.
Fonela xiengetelo xa xiengetelo hi ku tirhisa JavaScript:
- $ ( '#navbar' ). xiengetelo xa () .
Swihlawulekisi swi nga hundzisiwa hi ku tirhisa swihlawulekisi swa data kumbe JavaScript. Eka swihlawulekisi swa datha, engetela vito ra xihlawuhlawu eka data-
, tanihi le ka data-offset-top="200"
.
Vito | muxaka | ku tlula | nhlamuselo |
---|---|---|---|
offset | nomboro | ntirho | nchumu | 10. | Tipikseli to offset kusuka eka xikirini loko u hlayela xiyimo xa scroll. Loko ku nyikiwa nomboro yin’we, offset yi ta tirhisiwa eka matlhelo ya le henhla na ya ximatsi. Ku yingisela nkongomiso wun’we, kumbe ti-offset to tala to hlawuleka, nyika ntsena nchumu offset: { x: 10 } . Tirhisa ntirho loko u lava ku nyika hi ndlela leyi cinca-cincaka offset (leswi pfunaka eka tipulani tin’wana leti hlamulaka). |