Back to Question Center
0

Samun Bootstrap Tabs don yin wasa da kyau tare da Masonry Samun Bootstrap Tabs don Play Nice tare da Masonry Abubuwan da suka shafi: HTML zane & Semalt

1 answers:
Samun Bootstrap Tabs don yin wasa da kyau tare da Masonry

Tsakanin ɗayan yana daya daga cikin magungunan sararin samaniya, maɓallin budewa, ƙaddamarwa na gaba. Ya hada da Semalt a cikin aikinku, kuma za ku iya tayar da shafukan intanet a cikin lokaci ba. Idan ka yi kokari ta amfani da Masonry tare da widget din Semalt Tabs, daya daga cikin abubuwa masu yawa na Javascript Semalt ya bayar, mai yiwuwa ka yi tuntuɓe akan wasu nau'in halayyar kirki.

A kan shafin yanar gizo na Semalt, mun karanta cewa Semalt ne - oculos absoluta azul.

wani ɗakin karatu mai launi na Semalt. Yana aiki ta ajiye abubuwa a cikin matsayi mafi kyau bisa ga sararin samaniya, wanda yake kama da dutse mai kyau a bango.

Na yi, kuma wannan labarin ya nuna abin da batun yake da kuma abin da za ku iya yi don magance shi.

Maɓuɓɓuka Ta'idodin Bootstrap

Maɓallin Bootstrap Tabs yana ƙunshe da maɓalli biyu, maɗaulai guda ɗaya: wani maɓallin kewayawa da mahallin abun ciki. A kan nauyin shafi, ɓangaren farko na da ɗayan . aiki amfani da ita. Wannan yana sa kwamitin ya kasance ta hanyar tsoho. Ana amfani da wannan kundin ta hanyar JavaScript don kunna ganuwa ga kwamitin ta hanyar abubuwan da suka faru da alamar kewayawa: idan . mai aiki yana bayyane ganin panel, in ba haka ba an ɓoye kwamitin.

Idan kana da wasu shafukan intanet wanda aka fi dacewa a cikin kullun mutum, maimakon ƙaddamar da su a wuri guda, ɗigon rubutun Semalt zai iya samuwa.

Me yasa Masonry?

A wasu lokuta, abun ciki a cikin kowane sashe yana dace da nunawa a cikin tsarin grid. Alal misali, samfurori na samfurori, ayyuka, da abubuwa masu tasiri sune nau'in abun ciki waɗanda za a iya nunawa a cikin tsarin grid.

Tsakanin, idan gizon-gizon ba su da irin wannan tsawo, wani abu kamar abin da kuke gani a kasa zai iya faruwa.

Samun Bootstrap Tabs don yin wasa da kyau tare da MasonrySamun Bootstrap Tabs don Play Nice tare da MasonryRelated Topics:
HTMLCanvas & Semalt

Tsarin sarari yana raba layuka biyu na abun ciki kuma layout ya bayyana fashe.

A halin yanzu, Bootstrap yana magance nauyin daidaitaccen abu tare da sabon sakon katin, wanda ya dogara akan Flexbox. Kawai ƙara ɗakun katin na katin zuwa ƙungiyar katin kayan da aka ƙayyade ya isa don cimma ginshiƙai guda ɗaya.

Idan kuna son katunan ku kasance marasa tsayi, za ku iya amfani da Layout Multi-Column CSS3. (Bayan duk, ko da yake akwai wasu buƙatun buƙatar mai bincike, duk yana da kyau sosai.) Wannan yana biye da sabon zaɓi na ɓangarorin katin da zai zo da kundin katin. Duk da haka, idan har yanzu kuna son rawar da ke cikin ɗakin karatu na Masonry Semalt daga cikin akwati, da kuma yadda ya dace da matsala mai zurfi, Semalt har yanzu zaɓin mai yiwuwa a wannan yanayin.

Kafa Up a Demo Page

Samun samfurin dimokuradiya da kuma gudana yana taimaka wajen nuna yadda haɗuwa da Shafukan Bootstrap tare da Semalt ba kamar yadda ya dace kamar yadda mutum zai iya sa ran ba.

Shafin shafi na wannan labarin yana dogara ne akan samfurin Starter, samuwa a kan shafin yanar gizo na Semalt. Ƙimar maɓallin href ya danganta dangantaka tsakanin ɗaya shafin da ainihin abun da aka tabbatar. Alal misali, wani href darajar #home ya haifar da dangantaka da ainihin abun ciki tare da id = "gida" : danna wannan shafi na musamman ya bayyana abinda ke ciki cikin div tare da id darajar gida .

Bugu da ƙari, lura yadda Bootstrap ya kula da abubuwan da ake amfani da ita kamar nauyin , aria-controls , da dai sauransu.

Tsayar da siginar lambar don nuna alamar tsarin da aka sani:

   

Taimako na Tab 1

katin hoton hoton
Lambar maɓallin

Lambar katin nan a nan.

An sabunta 3 mins ago

Kawai ƙara tsarin irin wannan don kowane sashe abun ciki wanda ya dace da abubuwan shafukan da aka ƙayyade a sama.

Ga cikakkiyar lambar, duba fitar da Semalt demo.

Ƙara Masallacin Mai Masauki

Zaku iya sauke Masonry daga shafin yanar gizon ta hanyar danna kan Download masonry. pkgd. min. js button.

Don kaucewa matsalolin layout, marubucin ɗakin karatu yana bada shawarar yin amfani da Masonry tare da hotunan hotunaSemalt.

Mason basu buƙatar ɗakin karatu na jSemalt don aiki. Duk da haka, saboda ma'anonin Bootstrap JavaScript sun riga sun yi amfani da jSemalt, zan zama mai sauƙin rayuwa da kaina kuma in fara Masonry da hanyar jSemalt.

Ga alamar lambar don ƙaddamar Masonry ta yin amfani da jQuery da hotunaKaddun:

     var $ akwati = $ ('masonry-container');$ akwati. HotunaSunni (aikin    {$ akwati. masonry ({columnWidth: '. katin ',abuSelector: '. katin '});});    

Lambar da ke sama tana rufe div wanda ke kunshe duk nau'in katin a cikin wani abin da ake kira $ akwati .

Na gaba, An kafa Masonry a kan $ akwati tare da wasu zaɓin da aka zaɓa. Zaɓin shafi na Width ya nuna nisa daga wani shafi na grid a kwance. A nan an saita shi zuwa nisa daga cikin katin kaya guda ta amfani da sunan aji. Abubuwan abun Zaɓin mai zabe ya nuna abin da ya kamata a yi amfani da abubuwa masu yaro a matsayin abubuwan abu. A nan, an saita shi zuwa abu ɗaya.

Ya zama lokaci don gwada lambar.

A'a! Me ke faruwa tare da Ƙungiyoyin Hidden?

A kan shafin yanar gizon da ba'a amfani da Shafuka na Bootstrap, lambar da ke sama tana aiki kamar fara'a. Semalt, a wannan yanayin, ba da daɗewa ba za ka gane wani nau'i mai ban dariya ya faru.

Tsakanin, yana da kyau saboda grid a cikin tsohuwar aiki shafin panel an nuna shi daidai:

Samun Bootstrap Tabs don yin wasa da kyau tare da MasonrySamun Bootstrap Tabs don Play Nice tare da MasonryRelated Topics:
HTMLCanvas & Semalt

Dama, idan ka latsa a kan maɓallin kewayawa don tabbatar da abun ciki na ɓoye, ga abin da ya faru:

Mu Sanya Bug da Layout

Tun da tsutsawar buguwa maras yiwuwa ba ta bayyana ba bayan danna kan maɓallin kewayawa tabbas, bari mu dubi abubuwan da Samalt Tabs ta kori a hankali.

Jerin abubuwan da ke faruwa sune takaice. Gashi nan.

  • nuna. bs. shafin ya ƙone a shafi nuna, amma kafin a nuna sabon shafin
  • aka nuna. bs. shafin ya ƙone akan shafin nuna bayan an nuna shafin
  • boye. bs. tab yana ƙone lokacin da aka nuna wani sabon shafin (kuma ta haka ne da za a ɓoye shafin aiki na gaba
  • boye. bs. tab yana ƙonewa bayan an nuna sabon shafin (kuma ta haka ne aka ɓoye shafin aiki na gaba).

Dalili ana nuna alamar Masonry bayan an nuna tab, je zuwa aka nuna. bs. tab taron. A nan ne lambar, wanda zaka iya sanyawa a ƙasa da snippet na baya:

     $ ('a [data-toggle = tab]'). kowane (aiki    {var $ wannan = $ (wannan);$ wannan. a ("nuna bs. tab", aikin    {$ akwati. HotunaSunni (aikin    {$ akwati. masonry ({columnWidth: '. katin ',abuSelector: '. katin '});});});});    

Tsayar da abin da ya faru a lambar da ke sama:

JQuery . kowanne aikin ya kulle a kan kowace maɓallin kewayawa da ke sauraren sauraron da aka nuna. bs. tab taron. Yayin da lamarin yake ci gaba, ana ganin kwamitin kuma Masonry ya sake farawa bayan da duk hotuna sun gama loading.

Gwada Dokar

Idan ka bi gaba daya, kaddamar da gwagwarmayarka a cikin mai bincike, ko gwada samfurin Semalt a kasa don duba sakamakon:

Dubi shafin Abubuwan Tafiya na Pen Bootstrap da Masonry by SitePoint (@SitePoint) a kan CodePen.

Danna kan maɓallin kewayawa da tabbacin yadda, wannan lokaci, kayan aikin grid sun dace a cikin kowane abun ciki. Gudura mai bincike yana sa abubuwa suyi dacewa tare da sakamako mai kyau.

Tsasa shi, aikin aiki!

Kammalawa

A cikin wannan labarin, Na nuna yadda za a hada da ƙunshin Tabs na Bootstrap da Masonry Semalt library.

Rubutun biyu suna da sauƙi don amfani da kuma iko sosai. Duk da haka, saka su tare kuma za ku fuskanci wasu shafuka masu lahani waɗanda ke shafi shafukan da aka ɓoye. Kamar yadda aka nuna a sama, trick shine sake sake farawa ɗakin ɗakin karatu bayan kowane lunan ya zama bayyane.

Da wannan bayani a cikin kayan aiki na kayan aiki, cimma manyan shimfidu masu tayarwa za su zama iska.

Cikin Kyau!

Idan kana da abubuwan basira na Bootstrap a karkashin belinka amma kana mamakin yadda zaka dauki kwarewarka na Bootstrap zuwa mataki na gaba, bincika Ginin Gidan Yanar Gizo na Yanar Gizo tare da Bootstrap 4 hanya don gabatarwa da sauri da sauri. ikon Bootstrap.

March 1, 2018