Keen qaybaha Bootstrap nolosha-hadda oo wata 13 jQuery plugins oo caado ah.
Plugins-ka si gaar ah ayaa loogu dari karaa (inkasta oo qaarkood ay u baahdeen ku-tiirsanaan), ama dhammaan hal mar. Labada bootstrap.js iyo bootstrap.min.js waxay ka kooban yihiin dhammaan plugins hal fayl.
Waxaad isticmaali kartaa dhammaan Bootstrap plugins adiga oo isticmaalaya API calaamadaynta adiga oo aan qorin hal xariiq oo JavaScript ah. Kani waa API fasalka koowaad ee Bootstrap waana inuu noqdaa tixgelintaada ugu horreysa markaad isticmaalayso plugin.
Taasi waxay tidhi, xaaladaha qaarkood waxa laga yaabaa in la jeclaysto in la damiyo shaqadan. Sidaa darteed, waxaanu sidoo kale bixinaa awooda lagu curyaamiyo sifada xogta API annagoo ka saarayna dhammaan dhacdooyinka jidhka ee ku jira magaca ''data-api''. Tani waxay u egtahay sidan:
- $ ( 'jirka' ). off ( '.data-api' )
Haddii kale, si loo beegsado plugin gaar ah, kaliya ku dar magaca plugin-ka oo ah meel magac ah oo ay la socoto xogta-api namespace sidan oo kale:
- $ ( 'jirka' ). off ( '.alert.data-api' )
Waxaan sidoo kale aaminsanahay inaad awood u leedahay inaad isticmaasho dhammaan Bootstrap plugins iyada oo keliya JavaScript API. Dhammaan API-yada dadwaynaha waa hal, habab la silsiladi karo, oo soo celi ururinta lagu dhaqmay.
- $ ( ".btn.danger" ). badhanka ( "rogid" ). addClass ( "dufan" )
Dhammaan hababka waa in ay aqbalaan shay ikhtiyaari ikhtiyaari ah, xadhig bartilmaameed u ah hab gaar ah, ama waxba (kaas oo bilaabaya plugin leh dabeecad aan caadi ahayn):
- $ ( "#myModal" ). modal () // lagu bilaabay cillado
- $ ( "#myModal" ). modal ({ kiiboodhka : been }) // lagu bilaabay iyada oo aan lahayn kiiboobo
- $ ( "#myModal" ). modal ( 'show' ) // bilaaba oo ku baaqaa bandhiga isla markaaba
Plugin kasta waxa kale oo uu soo bandhigaa dhismeheeda ceeriin ee dhismaha 'Constructor': $.fn.popover.Constructor
. Haddii aad jeclaan lahayd inaad hesho tusaale plugin gaar ah, si toos ah uga soo celi curiyaha: $('[rel=popover]').data('popover')
.
Mararka qaarkood waa lagama maarmaan in la isticmaalo bootstrap plugins oo leh qaabab kale oo UI ah. Duruufahaan, isku dhacyada meel magac ayaa marmar dhici kara. Haddii tani dhacdo, waxaad wici .noConflict
kartaa plugin-ka aad rabto inaad dib u soo celiso qiimaha.
- var bootstrapButton = $ . fn . badhanka _ noConflict () // ku soo celi badhanka $.fn.qiimihii hore loo qoondeeyay
- $ . fn . bootstrapBtn = bootstrapButton // sii $() .bootstrapBtn shaqada bootstrap
Bootstrap waxay siisaa dhacdooyin caado u ah inta badan filalka gaarka ah ee plugin. Guud ahaan, kuwani waxay ku yimaadaan qaab aan dhammaad lahayn oo hore uga qayb-qaatay-halkaas oo aan dhammayn (tusaale ahaan show
) uu kiciyo bilawga dhacdada, iyo qaabkeedii hore ee ka qaybqaadashada (tus. shown
) uu kiciyo dhammaystirka ficilka.
Dhammaan dhacdooyinka aan dhamaadka lahayn waxay bixiyaan ka hortagga shaqeynta. Tani waxay siinaysaa awoodda lagu joojinayo fulinta ficilka ka hor inta uusan bilaaban.
- $ ( '#myModal' ). daaran ( 'show' , function ( e ) {
- haddii (! xog ) soo celiso e . ka hortaggaDefault () // waxay joojisaa habka in la tuso
- })
Saamaynta kala-guurka fudud, ku dar bootstrap-transition.js hal mar oo ay la socdaan faylalka kale ee JS. Haddii aad isticmaalayso bootstrap.js la soo ururiyey (ama la yareeyey) , looma baahna in lagu daro tan-horay ayay u jirtaa.
Tusaalayaal dhowr ah oo ku saabsan plugin-ka wareejinta:
Hababka waa la habeeyey, laakiin dabacsanaan, waxay kiciyaan wada hadal oo leh shaqada ugu yar ee loo baahan yahay iyo khaladaad caqli gal ah.
Hab la sameeyay oo leh madax, jidh, iyo hab ficil oo ku jira lugta.
Mid ka mid ah jir wanaagsan…
- <div class = "modal hide fade" >
- <div class = "modal-header" >
- <button type = "button" class = "close" data-dismiss = "modal" aria-hidden = "run" > × </button>
- <h3> Madaxa Modal </h3>
- </div>
- <div class = "modal-body" >
- <p> Hal jidh oo wanaagsan… </p>
- </div>
- <div class = "modal-footer" >
- <a href = "#" class = "btn"> Xir </a> _
- <a href = "#" class = "btn btn-primary" > Keydi isbeddelada </a>
- </div>
- </div>
U beddel habka JavaScript adoo gujinaya badhanka hoose. Hoos ayay u soo degi doontaa oo waxay ka soo geli doontaa xagga sare ee bogga.
- <!-- Button si loo kiciyo modal -->
- <a href = "#myModal" doorka = "button" class = "btn" data-toggle = "modal" > Bilaw demo modal </a>
- <!-- Modal -->
- <div id = "myModal" class = "modal hide fade" tabindex = "-1" doorka = "dialog" aria-labelledby = "myModalLabel" aria-hidden = "run" >
- <div class = "modal-header" >
- <button type = "button" class = "xir" data-dismiss = "modal" aria-hidden = "run" > × </button>
- <h3 id = "myModalLabel" > Madaxa qaabka </h3>
- </div>
- <div class = "modal-body" >
- <p> Hal jidh oo wanaagsan… </p>
- </div>
- <div class = "modal-footer" >
- <button class = "btn" data- dismiss = "modal" aria-hidden = "run" > Xir </button>
- <button class = "btn btn-primary" > Keydi isbeddelada </button>
- </div>
- </div>
Dhaqdhaqaaqa modal adigoon qorin JavaScript. Deji curiyaha data-toggle="modal"
kontoroolka, sida badhan, oo ay la socoto a data-target="#foo"
ama href="#foo"
si aad u beegsato hab gaar ah si aad u leexiso.
- <button type = "button" data-toggle = "modal" data-target = "#myModal" > Qaabka bilawga </button>
Wac modal leh id myModal
leh hal xariiq oo JavaScript ah:
- $ ( '#myModal' ). moodal ( ikhtiyaar )
Ikhtiyaarada waxaa lagu gudbi karaa sifada xogta ama JavaScript. Sifooyinka xogta, ku dheji magaca ikhtiyaarka data-
, sida ku jira data-backdrop=""
.
Magaca | nooca | default | sharaxaad |
---|---|---|---|
dib-u-dhac | booliyan | run | Waxaa ka mid ah curiyaha qaab-dhabeedka. Beddelkeeda, sheeg static meel-dambe oo aan xidhin habka gujiska. |
kiiboodhka | booliyan | run | Wuxuu xidhaa habka marka furaha baxsadka la riixo |
show | booliyan | run | Muujinaya habka marka la bilaabay. |
fogaan | waddo | been ah | Haddii url fog la bixiyo, waxa ku jira waxa lagu shubi doonaa
|
Waxay u hawlgelisaa macluumaadkaaga qaab habaysan. Aqbala ikhtiyaarka ikhtiyaariga ah object
.
- $ ( '#myModal' ). modal ({
- kiiboodhka : been
- })
Gacanta ayaa u roga modal
- $ ( '#myModal' ). moodal ( 'rogrogmi kara' )
Gacanta ayaa u fura modal
- $ ( '#myModal' ). moodal ( 'show' )
Gacanta ayaa u qarisa habka.
- $ ( '#myModal' ). modal ( 'Qarin' )
Bootstrap's modal class wuxuu daaha ka qaadaa dhowr dhacdo oo loogu talagalay in lagu xidho shaqaynta modal.
Dhacdo | Sharaxaada |
---|---|
show | Dhacdadani waxay isla markaaba gubataa marka show habka tusaalaha la yiraahdo. |
tusay | Dhacdadan waxa la eryaa marka habka loo muujiyo isticmaalaha (waxa ay sugi doontaa inta css kala guurka la dhamaystirayo). |
qari | Dhacdadan ayaa isla markaaba la eryaa marka hide habka tusaale ahaan loo waco. |
qarsoon | Dhacdadan waxa la eryaa marka modalku dhammeeyo in laga qariyo isticmaalaha (waxa ay sugi doontaa inta css kala guurka la dhamaystirayo). |
- $ ( '#myModal' ). daaran ( 'Qarin' , function () {
- // wax samee…
- })
Ku dar liiska hoos-u-dhaca wax kasta oo leh plugin-kan fudud, oo ay ku jiraan navbar, tabs, iyo kaniiniyada.
Ku dar data-toggle="dropdown"
xiriiriye ama badhan si aad u beddesho hoos u dhaca.
- <div class = "hoos u dhac" >
- <a class = "dropdown-toggle" data-toggle = "dropdown" href = "#" > kicinta hoos u dhaca </a>
- <ul class = "Dropdown-menu" doorka = "menu" aria-labelledby = "dLabel" >
- ...
- </ul>
- </div>
Si aad URL-yada u sii ahaato, isticmaal data-target
sifada beddelkii href="#"
.
- <div class = "hoos u dhac" >
- <a class = "dropdown-toggle" id = "dLabel" doorka = "button" data-toggle = "hoos u dhac" xogta-target = "#" href = "/page.html" >
- Hoos u dhigid
- <b class = "daryeel" </b>
- </a>
- <ul class = "Dropdown-menu" doorka = "menu" aria-labelledby = "dLabel" >
- ...
- </ul>
- </div>
Hoos ka wac JavaScript:
- $ ( '. dropdown-toggle' ). hoos u dhac ()
Midna
Api programmatic ah oo loogu rogaayo menu-yada ee navbar la bixiyay ama tabo-wareejinta.
Plugin ScrollSpy waxaa loogu talagalay si toos ah cusboonaysiinta bartilmaameedyada nav ku salaysan booska duudduuban. U rog aagga navbar ka hooseeya oo daawo isbeddelka fasalka firfircoon. Qodobada hoos u dhaca ayaa sidoo kale la iftiimin doonaa.
Ad leggings keytar, brunch id art party dolor labour. Pitchfork yr enim lo-fi ka hor inta aysan iibin qui. Tumblr beer-ilaa-miiska xuquuqda baaskiilka wax kasta ha ahaatee. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby funaanad lomo Jean shorts, williamsburg hoodie minim qui waxaa laga yaabaa inaadan maqlin iyaga iyo cardigan Trust fund culpa biodiesel wes anderson bilicda. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.
Veniam marfa shaarib skateboard, oo leh gadhka fugiat velit gadhka. Gadhka xorta ah aliqua cupidatat mcsweeney's vero. Cupidatat afar loko nisi, iyo helvetica nulla carles. Gaariga cuntada ee shaabada leh ee cosby funaanad, mcsweeney's quis non freegan vinyl. Lo-fi wes anderson +1 sartorial. Carles non bilicda jimicsiga quis gentrify. Brooklyn adipisicing craft biir ku xigeenka keytar deserunt.
Occaecat commodo aliqua delectus. Beerka farsamada gacanta ee deserunt skateboard ea. Xuquuqda baaskiilka Lomo adipisicing banh mi, velit ea sunt heerka xiga locavore kafee-kaliya ee magna veniam. Nolosha sare id vinyl, echo park consequat quis aliquip banh mi pitchfork. Vero VHS est adipisicing. Consectetur nisi DIY minim boorsada fariinta. Cred ex in, waarta delectus consectetur fanny pack iphone.
In incididunt echo park, officia deserunt mcsweeney's proident master cleanse thundercats sapiente veniam. Excepteur VHS elit, proident shoreditch +1 biodiesel laborum craft beer. Single-origin coffee wayfarers irure four loko, cupidatat terry richardson master cleanse. Assumenda you probably haven't heard of them art party fanny pack, tattooed nulla cardigan tempor ad. Proident wolf nesciunt sartorial keffiyeh eu banh mi sustainable. Elit wolf voluptate, lo-fi ea portland before they sold out four loko. Locavore enim nostrud mlkshk brooklyn nesciunt.
Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.
Keytar twee blog, culpa messenger bag marfa wax alla wixii gaari cunto ah oo delectus ah. Sapiente synth id la qaatay. Locavore sed helvetica cliche bir ah, onkod laga yaabo inaadan maqlin iyaga oo keenaya hoodie gluten-free lo-fi fap aliquip. Labore elit placeat ka hor inta aysan iibin, Terry Richardson oo aad u cad cad brunch nesciunt quis cosby funaanad pariatur keffiyeh ut helvetica artisan. Beerka farsamada gacanta ee Cardigan seitan velit diyaarsan. VHS chambray laboris tempor veniam. Anim mollit minim commodo ullamco onkod.
Si aad si fudud ugu darto dabeecadda scrollspy to your topbar navigation, kaliya ku dar data-spy="scroll"
element aad rabto in aad basaasaan on (inta badan sida caadiga ah tani waxay noqon doontaa jidhka) iyo data-target=".navbar"
in la doorto mid ka mid ah nav in la isticmaalo. Waxaad u baahan doontaa inaad isticmaasho scrollspy oo leh .nav
qayb.
- <body data-spy = "scroll" data-target = ".navbar" > ... </body>
Ka wac qoraalka qoraalka adigoo isticmaalaya JavaScript:
- $ ( '#navbar' ). scrollspy ()
<a href="#home">home</a>
waa in uu u dhigmaa shay ku jira guriga sida
<div id="home"></div>
.
Markaad isticmaalayso scrollspy iyadoo lala kaashanayo ku darista ama ka saarida walxaha DOM, waxaad u baahan doontaa inaad wacdo habka dib u cusboonaysiinta sida:
- $ ( '[xogta-basaasiga = "booq" ). mid kasta ( shaqo () {
- var $ Spy = $ ( kan ). scrollspy ( 'cusbooneysii' )
- }
Ikhtiyaarada waxaa lagu gudbi karaa sifada xogta ama JavaScript. Sifooyinka xogta, ku dheji magaca ikhtiyaarka data-
, sida ku jira data-offset=""
.
Magaca | nooca | default | sharaxaad |
---|---|---|---|
dhimis | tirada | 10 | Pixels in laga bilaabo xagga sare marka la xisaabinayo booska rogid. |
Dhacdo | Sharaxaada |
---|---|
firfircooni | Dhacdadani waxay dab kacaysaa mar kasta oo shay cusub uu hawl galo duubista. |
Ku dar hawlqabad tab degdeg ah, firfircoon si aad ugu gudubto muraayadaha nuxurka gudaha, xitaa iyada oo loo marayo menus-hoosaadka.
Denim cayriin waxaa laga yaabaa inaadan maqlin iyaga Jean-gaaban Austin. Nesciunt tofu stumptown aliqua, retro synth master nadiifinta. Shaarubaha cliche tempor, williamsburg carles vegan helvetica. Reprehenderit hiliblaha retro keffiyeh dreamcatcher synth. Cosby funaanad eu banh mi, qui irure terry richardson ex squid. Sida loo sameeyo salvia cillum iphone. Seitan aliquip quis cardigan dharka mareykanka, hiliblaha 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 cayriin denim keffiyeh etsy xisbiga fanka ka hor inta aysan iibin Master Cleanse gluten-free Squid scenester freegan cosby funaanad. Fanny pack portland seitan DIY, xaflad farshaxan locavore wolf cliche nolosha sare echo park Austin. Cred vinyl keffiyeh DIY salvia PBR, banh mi ka hor inta aysan iibin beer-ilaa-miiska VHS viral locavore cosby funaanad. Lomo wolf viral, shaarubaha diyaarsan onkod keffiyeh craft beer marfa anshax. Wolf salvia freegan, sartorial keffiyeh echo park vegan.
U oggolow tab tabsiyada JavaScript-ka (tabo kastaa waxay u baahan tahay in si gaar ah loo hawlgeliyo):
- $ ( '#myTab a' ). guji ( function ( e ) {
- e . ka hortaggaDefault ();
- $ ( kan ). tab ( 'show' );
- })
Waxaad u dhaqaajin kartaa tabs shaqsiyeed dhowr siyaabood:
- $ ( '#myTab a[href="#profile"]' ). tab ( 'show' ); // Dooro tab magac ahaan
- $ ( '#myTab a: first' ). tab ( 'show' ); // Dooro tab ugu horeysa
- $ ( '#myTab a: last' ). tab ( 'show' ); // Dooro tab ugu dambeeya
- $ ( '#myTab li:eq(2) a' ). tab ( 'show' ); // Dooro tab saddexaad (0-indexed)
Waxaad dhaqaajin kartaa tab ama kaniiniga navigation adoon qorin wax JavaScript ah adiga oo si fudud u qeexaya data-toggle="tab"
ama data-toggle="pill"
shay. Ku darista nav
iyo nav-tabs
xiisadaha tab ul
waxay dabaqi doontaa habaynta tabka Bootstrap.
- <ul class = "nav nav-tabs" >
- <li><a href = "#home" data-toggle = "tab" > Guriga </a></li>
- <li><a href = "#profile" data-toggle = "tab" > Profile </a></li>
- <li><a href = "#messages" data-toggle = "tab" > Fariimaha </a></li>
- <li><a href = "#settings" data-toggle = "tab"> Settings </a></li >
- </ul>
Wuxuu hawlgeliyaa curiyaha tab iyo weelka ka kooban. Tabku waa inuu lahaadaa mid data-target
ama meel la href
beegsanayo noodhka weelka ee DOM.
- <ul class = "nav nav-tabs" id = "myTab" >
- <li class = "firfircoon" ><a href = "#guriga" > Guriga </a></li>
- <li><a href = "#profile" > Profile </a></li>
- <li><a href = "#farimaha" > Fariimaha </a></li>
- <li><a href = "#Settings" > Dejinta </a></li>
- </ul>
- <div class = "tab-content" >
- <div class = "tab-pane active" id = "guri" > ... </div>
- <div class = "tab-pane" id = "profile" > ... </div>
- <div class = "tab-pane" id = "farimaha" > ... </div>
- <div class = "tab-pane" id = "settings" > ... </div>
- </div>
- <script>
- $ ( shaqada () {
- $ ( '#myTab a: last' ). tab ( 'show' );
- })
- </script>
Dhacdo | Sharaxaada |
---|---|
show | Dhacdadani waxay ku shidan tahay bandhiga tab, laakiin ka hor intaan tab cusub la muujin. Isticmaal event.target oo event.relatedTarget si aad u beegsato tab firfircoon iyo tabtii hore ee firfircoonayd (haddii la heli karo) siday u kala horreeyaan. |
tusay | Dhacdadani waxay ku gubanaysaa bandhiga tab ka dib marka tab la muujiyo. Isticmaal event.target oo event.relatedTarget si aad u beegsato tab firfircoon iyo tabtii hore ee firfircoonayd (haddii la heli karo) siday u kala horreeyaan. |
- $ ( 'a[data-toggle="tab"]' ). daaran ( 'la tusay' , shaqada ( e ) {
- e . bartilmaameed // tab firfircoon
- e . laxiriiraTarget // tab hore
- })
Waxaa dhiirigeliyay plugin jQuery.tipsy ee aad u wanaagsan oo uu qoray Jason Frame; Tilmaamaha qalabku waa nooc la cusboonaysiiyay, kaas oo aan ku tiirsanayn sawirada, u isticmaal CSS3 animations, iyo xogta sifada kaydinta cinwaanka maxaliga ah.
Sababaha waxqabadka awgood, aaladda tip-ka iyo popover data-apis ayaa door biday, taasoo la macno ah in aad adigu bilawdo .
Ka dul rog xiriirka hoose si aad u aragto aaladaha:
Surwaal dhagan keffiyeh malaha maadan maqlin iyaga. Photo booth gadhka cayriin denim warqad-press vegan messenger bag stumptown. Beer-ilaa-miiska seitan, mcsweeney's fixie sustainable quinoa 8-bit dharka maraykanku waxay leeyihiin terry Richardson vinyl chambray. Gadhka stumptown, cardigans banh mi lomo thundercats. Tofu biodiesel williamsburg marfa, afar loko mcsweeney's chambray vegan nadiif ah. Farsamoyaqaan dhab ah oo biro ah wax kasta oo keytar , scenester farm-to-table banksy Austin twitter handle freegan cred denim ceeriin hal-asalka kafeega viral.
Markaad isticmaalayso qalab-tips iyo popovers kooxaha gelinta Bootstrap, waa inaad dejisaa container
ikhtiyaarka (hoos ku qoran) si aad uga fogaato waxyeelooyinka aan loo baahnayn.
Ku kiciya tilmaanta aalada JavaScript:
- $ ( '#tusaale' ). qalab ( ikhtiyaar )
Ikhtiyaarada waxaa lagu gudbi karaa sifada xogta ama JavaScript. Sifooyinka xogta, ku dheji magaca ikhtiyaarka data-
, sida ku jira data-animation=""
.
Magaca | nooca | default | sharaxaad |
---|---|---|---|
animation | booliyan | run | codso u gudubka css libdhi xagga qalabka |
html | booliyan | been ah | Geli html galka qalabka Haddii ay been tahay, habka jquery ayaa text loo isticmaali doonaa in la geliyo waxa ku jira guriga. Isticmaal qoraal haddii aad ka welwelsan tahay weerarrada XSS. |
meelaynta | xadhig | shaqayn | 'sare' | sida loo dhigo tip-tip-top | hoose | bidix | xaq |
dooriye | xadhig | been ah | Haddii la bixiyo doorasho, walxaha tibaaxaha ah waxaa loo igman doonaa bartilmaameedyada la cayimay. |
horyaalka | xadhig | shaqayn | '' | Qiimaha cinwaanka caadiga ah haddii 'ciwaanka' taaga uusan jirin |
kicin | xadhig | 'fiirsashada dulsaarka' | sida qalabka loo kiciyo - guji | dullid | diiradda | buug-gacmeedka. Ogsoonow in kiisku dhaafo kiciyeyaasha mutliple, meel bannaan oo kala soocan, noocyada kiciya. |
dib u dhac | lambarka | walax | 0 | daahitaanka muujinta iyo qarinta aaladda (ms) - kuma khusayso nooca kiciya gacanta Haddii nambar la keeno, dib u dhac ayaa lagu dabaqayaa qarinta/muujinta labadaba Qaab dhismeedka shaygu waa: |
weel | xadhig | been ah | been ah | Waxay ku dhejisaa caarada aaladda shay gaar ah |
- <a href = "#" data-toggle = "tooltip" title = "tooltip first" > i dul heehaab </a>
Wuxuu ku lifaaqaa gacan hayaha qalab ururinta walxaha.
Waxay daaha ka qaadaysaa aaladda curiyaha
- $ ( '# element' ). qalab tip ( 'show' )
Wuxuu qariyaa calaamadda curiyaha.
- $ ( '# element' ). qalab ( 'Qarin' )
Beddelayaa shay raadka.
- $ ( '# element' ). Tooltip ( 'rogid' )
Qariyaa oo burburiyaa aaladda curiyaha.
- $ ( '# element' ). Tooltip ( 'burbur' )
Ku dar waxyaabo yaryar oo dulsaaran, sida kuwa iPadka, shay kasta oo loogu talagalay macluumaadka labaad ee guriyeynta. Dul mar badhanka si aad u kiciso popover-ka Waxay u baahan tahay tilmaan -bixinta in lagu daro.
Afar doorasho ayaa diyaar ah: sare, midig, hoose, iyo bidix oo toosan.
Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.
Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.
Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.
Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.
Ma jiro calaamad muujinaysa sida popovers laga soo saaray JavaScript iyo macluumaadka ku jira data
sifo.
U oggolow popovers iyada oo loo marayo JavaScript:
- $ ( '#tusaale' ). popover ( doorashooyinka )
Ikhtiyaarada waxaa lagu gudbi karaa sifada xogta ama JavaScript. Sifooyinka xogta, ku dheji magaca ikhtiyaarka data-
, sida ku jira data-animation=""
.
Magaca | nooca | default | sharaxaad |
---|---|---|---|
animation | booliyan | run | codso u gudubka css libdhi xagga qalabka |
html | booliyan | been ah | Geli html goobta popover-ka Haddii ay been tahay, habka jquery ayaa text loo isticmaali doonaa in la geliyo waxa ku jira guriga. Isticmaal qoraal haddii aad ka welwelsan tahay weerarrada XSS. |
meelaynta | xadhig | shaqayn | 'sax' | sida loo dhigo popover - top | hoose | bidix | xaq |
dooriye | xadhig | been ah | haddii la bixiyo doorasho, walxaha tibaaxaha ah waxaa loo igman doonaa bartilmaameedyada la cayimay |
kicin | xadhig | 'guji' | sida popover loo kiciyo - guji | dullid | diiradda | buug-gacmeedka |
horyaalka | xadhig | shaqayn | '' | Qiimaha cinwaanka caadiga ah haddii 'cinwaanka' uusan jirin |
nuxurka | xadhig | shaqayn | '' | Qiimaha nuxurka caadiga ah haddii 'data-content' sifo aysan jirin |
dib u dhac | lambarka | walax | 0 | daahitaanka muujinta iyo qarinta popover (ms) - kuma khusayso nooca kiciya gacanta Haddii nambar la keeno, dib u dhac ayaa lagu dabaqayaa qarinta/muujinta labadaba Qaab dhismeedka shaygu waa: |
weel | xadhig | been ah | been ah | Ku dhejinta popover-ka shay gaar ah |
Sababaha waxqabadka awgood, Tooltip iyo Popover data-apis ayaa door biday. Haddii aad rabto inaad isticmaasho kaliya caddee ikhtiyaarka xulashada.
Wuxuu u bilaabaa popovers ururinta curiyaha.
Waxay daaha ka qaadaysaa curiyayaasha soo booda.
- $ ( '# element' ). popover ( 'muuji' )
Waxay qarisaa curiyayaasha soo booda.
- $ ( '# element' ). popover ( 'Qarin' )
Wuxuu rogaa curiyayaasha soo booda
- $ ( '# element' ). popover ( "rogrogmi" )
Qariyaa oo baabi'iyaa popover element.
- $ ( '# element' ). popover ( 'burbur' )
Ku dar shaqada ka eryida dhammaan fariimaha digniinta leh ee plugin this.
Beddel kan iyo taas oo isku day mar kale. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras mattis consectetur purus sit amet fermentum.
U oggolow cayrinta digniinta iyada oo loo marayo JavaScript:
- $ ( ". heegan" ). heegan ()
Kaliya ku dar data-dismiss="alert"
badhanka ku dhow si aad si toos ah u siiso hawlgelinta heeganka dhow.
- <a class = "close" data-dismiss = "alert" href = "#" > × </a>
Waxay ku duubtaa dhammaan digniinaha oo leh shaqeyn dhow. Si ogeysiisyadaadu u soo baxaan marka la xiro, hubi inay haystaan .fade
iyo .in
fasalka mar hore lagu dabaqay iyaga.
Xidhaa digniinta
- $ ( ". heegan" ). heegan ( 'xir' )
Fasalka feejignaanta ee Bootstrap wuxuu daaha ka qaadaa dhowr dhacdo oo loogu talagalay in lagu xidho shaqaynta heeganka.
Dhacdo | Sharaxaada |
---|---|
dhow | Dhacdadani waxay isla markaaba gubataa marka close habka tusaalaha la yiraahdo. |
xiran | Dhacdadan waxa la eryaa marka digniinta la xidho (waxa ay sugi doontaa inta css kala guurka la dhamaystirayo). |
- $ ( '# feejignaantayda' ). xidhi ( 'xiran' , function () {
- // wax samee…
- })
U hel qaababka aasaasiga ah iyo taageerada dabacsan ee qaybaha burburi kara sida accordions iyo navigation.
* Waxay u baahan tahay plugin Transitions in lagu daro.
Annaga oo adeegsanayna plugin burburka, waxaan dhisnay widget qaab accordion fudud:
- <div class = "accordion" id = "accordion2" >
- <div class = "accordion-group" >
- <div class = "accordion-heading" >
- <a class = "accordion-toggle" data-toggle = "collapse" data-parent = "#accordion2" href = "#collapseOne" >
- Kooxda La Burburin karo Shayga #1
- </a>
- </div>
- <div id = "collapseOne" class = "accordion-body burburay gudaha" >
- <div class = "accordion-inner" >
- Anim pariatur cliche...
- </div>
- </div>
- </div>
- <div class = "accordion-group" >
- <div class = "accordion-heading" >
- <a class = "accordion-toggle" data-toggle = "collapse" data-parent = "#accordion2" href = "#collapseTwo" >
- Kooxda La Burburin karo Shayga #2
- </a>
- </div>
- <div id = "collapseTwo" class = "accordion-body collapse" >
- <div class = "accordion-inner" >
- Anim pariatur cliche...
- </div>
- </div>
- </div>
- </div>
- ...
Waxa kale oo aad isticmaali kartaa plugin la'aanteed calaamadda accordion. Samee badhanka beddel fidinta iyo burburka shay kale.
- <button type = "button" class = "btn btn-danger" data-toggle = "collapse" data-target = "#demo" >
- fudud oo la dumin karo
- </button>
- <div id = "demo" class = "ku dumi" > … </div>
Kaliya ku dar data-toggle="collapse"
oo a data-target
curiye si si toos ah loogu qoondeeyo xakamaynta shay burburi kara. Sifadu data-target
waxay aqbashaa css-dooriyaha si loogu dabaqo burburka. U hubso inaad fasalka ku darto collapse
walxaha duminaya. Haddii aad rabto in uu furmo, ku dar fasalka dheeraadka ah in
.
Si loogu daro maamulka kooxda accordion u eg kantaroolka burburi kara, ku dar xogta sifada data-parent="#selector"
. Tixraac demo si aad u aragto tan ficil ahaan
Ku oggolow gacanta:
- $ ( ". dumay" ). burbur ()
Ikhtiyaarada waxaa lagu gudbi karaa sifada xogta ama JavaScript. Sifooyinka xogta, ku dheji magaca ikhtiyaarka data-
, sida ku jira data-parent=""
.
Magaca | nooca | default | sharaxaad |
---|---|---|---|
waalid | dooriye | been ah | Haddii dooraha markaas dhammaan walxaha burburi kara ee hoos yimaada waalidka la cayimay waa la xidhi doonaa marka shaygan dumin kara la muujiyo. (oo la mid ah hab-dhaqanka hab-dhaqanka dhaqanka) |
leexleex | booliyan | run | Wuxuu beddelaa cunsurka burburi kara marka la codsado |
Waxay u hawlgelisaa macluumaadkaaga sidii shay burburi kara. Aqbala ikhtiyaarka ikhtiyaariga ah object
.
- $ ( '#my Collapsible' ). burbur ({
- leexo : been
- })
U rogaa shay burburi kara si loo muujiyo ama loo qariyo.
Wuxuu muujiyaa shay burburi kara.
Qariyaa shay burburi kara.
Fasalka burburka Bootstrap wuxuu daaha ka qaadaa dhowr dhacdo oo loogu talagalay ku xirida shaqeynta burburka.
Dhacdo | Sharaxaada |
---|---|
show | Dhacdadani waxay isla markaaba gubataa marka show habka tusaalaha la yiraahdo. |
tusay | Dhacdadan waxa la eryaa marka curiyaha burburku la arko isticmaaluhu (waxay sugi doontaa inta css kala guurka la dhamaystirayo). |
qari | Dhacdadan ayaa isla markiiba la eryaa marka hide habka loo waco. |
qarsoon | Dhacdadan waxa la eryaa marka walxaha burburay laga qariyay isticmaalaha (waxa ay sugi doontaa inta css kala guurka la dhamaystirayo). |
- $ ( '#my Collapsible' ). daaran ( 'Qarin' , function () {
- // wax samee…
- })
Muuqaalka hoose wuxuu muujinayaa plugin guud iyo qayb loogu talagalay baaskiil wadista walxaha sida carousel-ka.
- <div id = "myCarousel" class = "carousel slide" >
- <ol class = "carousel-indexators" >
- <li data-target = "#myCarousel" data-slide-to = "0" class = "firfircoon" </li>
- <li data-target = "#myCarousel" data-slide-to = "1" ></li>
- <li data-target = "#myCarousel" data-slide-to = "2" </li>
- </ol>
- <!-- Alaabta carousel -->
- <div class = "carousel-inner" >
- <div class = "wax firfircoon" > … </div>
- <div class = "shay" > … </div>
- <div class = "shay" > … </div>
- </div>
- <!-- Carousel nav -->
- <a class = "carousel-control left" href = "#myCarousel" data-slide = "prev" > ‹ </a>
- <a class = "carousel-control right" href = "#myCarousel" data-slide = "ku xiga" > & rsaquo; </a>
- </div>
Isticmaal sifada xogta si aad si fudud u xakamayso booska carouselka. data-slide
aqbala ereyada furaha prev
ama next
, kaas oo beddela booska slide marka loo eego booska uu hadda joogo. Haddii kale, isticmaal data-slide-to
si aad u gudbiso tusmaynta slide ceeriin ee carousel data-slide-to="2"
, kaas oo ka boodaya booska duleelka tusmo gaar ah oo ka bilaabmaya 0
.
Si gacanta ah ula wac carousel:
- $ ( '.carousel' ). carousel ()
Ikhtiyaarada waxaa lagu gudbi karaa sifada xogta ama JavaScriptz. Sifooyinka xogta, ku dheji magaca ikhtiyaarka data-
, sida ku jira data-interval=""
.
Magaca | nooca | default | sharaxaad |
---|---|---|---|
dhexda | tirada | 5000 | Qadarka wakhtiga dib u dhigista udhaxaysa si toos ah shay baaskiil wadida. Haddii ay been tahay, carousel si toos ah uma wareegeyso. |
hakad | xadhig | "hoos u dhac" | Waxa uu hakiyaa baaskiilka carouselka ee mouseenterka oo dib u bilaabaya baaskiilka carouselka ee mouseleave. |
Waxay ku bilawday carousel-ka ikhtiyaar ikhtiyaari ah object
oo bilaabay inuu ku dhex wado alaabta.
- $ ( '.carousel' ). carousel ({
- inta u dhaxaysa : 2000
- })
Wareegtada dhex mara alaabta carouselka bidix ilaa midig.
Karoosalka ka joojiya in uu baaskiil ku dhex maro alaabta.
Wareega karooselka si uu u sameeyo jir gaar ah (0 ku salaysan, oo la mid ah array).
Wareegto shayga hore
Wareegto shayga xiga
Fasalka carousel ee Bootstrap wuxuu daaha ka qaadaa laba dhacdo oo loogu talagalay ku-qabsiga shaqada carousel-ka.
Dhacdo | Sharaxaada |
---|---|
simbiriirixan | Dhacdadani waxay isla markiiba gubtaa marka slide habka tusaalaha loo yeedho. |
silbadh | Dhacdadan ayaa la eryaa marka carouselku dhammeeyo kala-guurka slide-ka. |
Qalab aasaasi ah, oo si fudud loo fidiyey si dhakhso ah loogu abuuro madax-qoritaan xarrago leh oo leh qaab kasta oo qoraal ah.
- <input type = "text" data-provide = "typeahead" >
Waxaad u baahan doontaa inaad dejiso autocomplete="off"
si aad uga ilaaliso menu-yada browser-ka caadiga ah inay ka soo baxaan hoos-u-dhaca nooca Bootstrap.
Ku dar sifada xogta si aad u diiwaan geliso shay leh shaqaynta nooca-head sida ku cad tusaalaha kore.
Si gacanta ugu wac nooca-head:
- $ ( '.typehead' ). qoriga ()
Ikhtiyaarada waxaa lagu gudbi karaa sifada xogta ama JavaScript. Sifooyinka xogta, ku dheji magaca ikhtiyaarka data-
, sida ku jira data-source=""
.
Magaca | nooca | default | sharaxaad |
---|---|---|---|
isha | habayn, shaqo | [ ] | Isha xogta si wax looga weydiiyo. Waxa laga yaabaa in ay noqoto tiro xargo ah ama shaqo. Hawsha waxa la dhaafaa laba doodood, query qiimaha goobta gelinta iyo process dib u yeedhista. Shaqada waxaa loo isticmaali karaa si isku mid ah iyadoo loo soo celinayo isha xogta si toos ah ama si isku mid ah iyada oo loo marayo process dooda kaliya ee dib u yeerista. |
alaabta | tirada | 8 | Tirada ugu badan ee alaabta lagu muujinayo hoos u dhaca. |
Dhererka da'da | tirada | 1 | Dhererka xarfaha ugu yar ee loo baahan yahay ka hor inta aan la kicin talooyinka dhammaystiran |
dheele | shaqayn | kiis aan dareen lahayn | Habka loo isticmaalo in lagu go'aamiyo haddii weydiintu la mid tahay shay. Aqbala hal dood, item ka soo horjeedda oo lagu tijaabiyo weydiinta. Ku gal weydiinta hadda this.query . Soo celi boolean true haddii weydiintu tahay mid isku mid ah. |
kala soocida | shaqayn | u dhigma saxda ah, kiis xasaasi ah, kiis dareen la'aan ah |
Habka loo isticmaalo in lagu kala saaro natiijooyinka otomaatiga ah. Aqbal hal dood items oo leh baaxadda tusaalaha nooca-head. Tixraac su'aalaha hadda jira this.query . |
updater | shaqayn | soo celisaa shay la doortay | Habka loo isticmaalo soo celinta shay la doortay. Aqbala hal dood, item oo leh baaxadda tusaalaha nooca madax. |
iftiimiye | shaqayn | waxay iftiimisaa dhammaan kulammada aan caadiga ahayn | Habka loo isticmaalo in lagu muujiyo natiijooyinka otomaatiga ah. Aqbal hal dood item oo leh baaxadda tusaalaha nooca-head. Waa inuu soo celiyaa html |
Wuxuu ku bilaabayaa wax gelinta oo leh madax-madaxeedka.
Navigation hoose ee bidix waa demo toos ah ee plugin lifaaqa ah.
Si aad si sahal ah ugu darto habdhaqanka lifaaqa shay kasta, kaliya ku dar data-spy="affix"
walxaha aad rabto in aad basaasto. Ka dib isticmaal offsets si aad u qeexdo goorta la beddelo ku xidhka curiyaha daar iyo dami.
- <div data-spy = "affix" data-offset-top = "200" > ... </div>
affix
,
affix-top
iyo
affix-bottom
. Xusuusnow inaad hubiso waalidka dhici kara inuu burburay marka lifaaqu soo gasho maadaama ay ka saarayso macluumaadka socodka caadiga ah ee bogga.
Ka wac plugin ku lifaaqan JavaScript:
- $ ( '#navbar' ). ku dheji ()
Ikhtiyaarada waxaa lagu gudbi karaa sifada xogta ama JavaScript. Sifooyinka xogta, ku dheji magaca ikhtiyaarka data-
, sida ku jira data-offset-top="200"
.
Magaca | nooca | default | sharaxaad |
---|---|---|---|
dhimis | lambarka | shaqada | walax | 10 | Pixels si looga saaro shaashadda marka la xisaabinayo booska duudduuban. Haddii hal nambar la bixiyo, kabista waxa lagu dabaqi doonaa jihooyinka sare iyo bidixda labadaba. Si aad u dhegaysato hal jiho, ama meelo badan oo gaar ah, kaliya bixi shay offset: { x: 10 } . Isticmaal shaqo marka aad u baahan tahay inaad si firfircoon u bixiso kabista (waxtar u leh qaar ka mid ah naqshadaha jawaabaha leh). |