Bootstrap Modal Qhov rai: Lub Hom Phiaj thiab Kev Siv

Cov txheej txheem:

Bootstrap Modal Qhov rai: Lub Hom Phiaj thiab Kev Siv
Bootstrap Modal Qhov rai: Lub Hom Phiaj thiab Kev Siv
Anonim

Bootstrap modal yog dab tsi thiab nws yog dab tsi? Dab tsi yog nws cov khoom, nta, qhov zoo thiab qhov tsis zoo? Lub tswvyim ntawm "modal window" yog siv nyob rau hauv lub graphical interface. Feem ntau nrog nws cov kev pab koj tuaj yeem mloog rau qee qhov xwm txheej tseem ceeb. Modal windows yog siv los nkag rau qee cov ntaub ntawv, cov ntaub ntawv, hloov chaw. Lawv thaiv tus neeg siv cov kev ua haujlwm kom txog thaum qhov teeb meem lossis kev ua tiav. Windows kuj tseem siv los tsim cov nplooj ntawv web.

bootstrap modal qhov rais
bootstrap modal qhov rais

Yooj yim customizable thiab teb tsim, uas yog dab tsi Bootstrap muaj hnub no. Lub qhov rais modal, ib daim ntawv uas tuaj yeem siv los tsim cov vev xaib, pab qhia cov duab, yeeb yaj kiab, thiab lwm yam. Lub popup muaj qhov sib txawv ntawm qhov rub tawm: lub npe, lub cev, thiabfooter. Txhua yam ntawm cov ntsiab lus no muaj nws lub ntsiab lus. Lub hom phiaj tseem ceeb ntawm Bootstrap modal window yog siv los ntawm cov neeg tsim qauv tshiab los tsim cov nplooj ntawv web yam tsis tau sau cov lej ntxiv. Lub qhov rais modal yog ib hom thawv uas sau cov ntsiab lus tso tawm kom pom. Lub modal tivthaiv daws ntau yam ntawm cov hom phiaj.

bootstrap modal kaw
bootstrap modal kaw

Yuav ua li cas?

Lub qhov rais modal yog tsim thiab tswj siv JavaScript, cov ntaub ntawv thiab css txoj kev. Ua ntej koj yuav tsum tau ua markup. Nws muaj ib tug ncej, header, ntsiab ntsiab lus, thiab footer. Yam yuav tsum tau muaj ntawm no yog lub qab daus (block) thiab thav duab. Tom qab lub markup, koj yuav tsum tau mus rau qhov kev siv ntawm lub modal qhov rais hu. Feem ntau nws yog hu ua tom qab thauj cov nplooj ntawv web thiab nias lub pob sib txuas. Kev hu yog tsim los ntawm cov ntaub ntawv thiab JavaScript. Kaw lub Bootstrap modal kaw cov haujlwm yav dhau los thiab tau txais kev cawmdim.

Nco ntsoov tias lub qhov rais modal muaj nws tus yam ntxwv. Txhawm rau qhib ntau lub qhov rais modal, koj yuav tsum sau cov lej ntxiv. Nws yog qhov zoo tshaj rau tso html code rau saum cov ntaub ntawv, tom qab lub cev tag. Qhov no yuav pab khaws cia lub functionality thiab tsos ntawm lub qhov rais. Ntawm cov khoom siv mobile, muaj cov lus ceeb toom hais txog kev siv lub qhov rais modal. Lawv txwv nws txoj kev siv tag nrho. Bootstrap 3 tso cai rau qhov ntau thiab tsawg qhov rais raws li daim phiaj.

bootstrap 3 modal qhov rais
bootstrap 3 modal qhov rais

Cov ntsiab lus

Ua ntejTxhawm rau pib ua haujlwm nrog Bootstrap, koj yuav tsum paub seb nws muaj dab tsi. Qhov kev zov me nyuam suav nrog cov txheej txheem npaj ua tiav uas siv los tsim cov vev xaib. Npaj-ua JavaScript, CSS thiab HTML styles tsim ib daim phiaj hloov, tso saib khawm, menus, icons, tooltips, thiab ntau dua. Cov qauv software yooj yim yuav tsum muaj rau kev teeb tsa. Lub xub ntiag ntawm cov qauv rau kev luam ntawv thiab cov ntawv tso cai rau koj los npaj qhov browser rau luam tawm nplooj ntawv thiab ua tus tsim cov ntawv nyeem cov ntsiab lus ntawm qhov chaw. Nrog Bootstrap Cheebtsam, koj tuaj yeem tsim cov ntawv, khawm, thiab lwm yam. Qhov kev zov me nyuam muaj tag nrho cov cuab yeej ua kom sai thiab yooj yim ua nplooj ntawv rau cov khoom siv txawb. Bootstrap yog tsim los ntawm ntau lwm yam ntsiab lus nrog rau JavaScript. Lawv yog ib qho yooj yim txaus rau master txawm rau ib tug beginner. Hauv txoj kev xav, kev nkag siab txog cov hauv paus ntawm Bootstrap program tsis yooj yim txaus. Hauv kev xyaum, qhov kev txhim kho no ua kom yooj yim rau kev ua haujlwm ntawm tus tsim qauv thiab tsim qauv tsim vim muaj ntau cov khoom npaj ua tiav.

bootstrap modal daim ntawv
bootstrap modal daim ntawv

Ntse

Bootstrap modal muaj qee qhov txiaj ntsig tshwj xeeb. Nrog nws cov kev pab, kev txhim kho nplooj ntawv layouts rau cov vev xaib siv qhov chaw ntawm kev kub ceev. Lub qhov rais suav nrog cov txheej txheem loj thiab cov kev daws teeb meem npaj txhij. Bootstrap ua rau koj lub vev xaib teb ntau dua. Lub moj khaum (software) haum rau txhua tus browsers thiab tso tawm kom raug hauv lawv. Lub qhov rais modal no yooj yim siv. Bootstrap tso cai rau koj los tsim cov nplooj ntawv web txawm rau cov pib tshiab uas muaj kev paub txog CSS thiab HTML.

Qhov peculiarity ntawm lub qhov rais modal yog qhov ntawduas cov neeg siv tau yooj yim hloov mus rau nws. Ntau cov qauv npaj ua tiav thiab cov ntaub ntawv zoo ua rau nws yooj yim kom nce mus nrawm nrog Bootstrap. Txog nws qhov zoo tuaj yeem yog qhov tseem ceeb ntawm kev xaiv loj ntawm cov ntsiab lus rau kev tsim. Wordpress, CMS, Joomla tau tsim nrog lub qhov rais modal no. Bootstrap yog lub vev xaib uas muaj cov khoom tsim nyog thiab tau txais txiaj ntsig nrog nws tus kheej lub cim font. Nws suav nrog ntau dua ob puas lub cim, suav nrog cov qauv yooj yim.

Cons

Bootstrap's modal muaj nws qhov tsis zoo.

  • Qhov chaw siv nws poob lawv tus kheej style. Lawv tsis muaj qhov tshwj xeeb, vim lawv zoo sib xws hauv cov tsos thiab qauv rau ib leeg.
  • Tsis yooj yim; feem ntau yuav tsum tau tsim koj tus kheej style thiab ua haujlwm ntxiv.
  • Hloov tus lej thauj khoom tuaj yeem ua rau cov sijhawm ua haujlwm.
  • Cov neeg siv feem ntau siv cov khoom siv Bootstrap yuam kev.

Siv cov cuab yeej no rau kev txhim kho pem hauv ntej. Txawm hais tias muaj qhov tsis txaus ntseeg uas yuav pom tseeb rau cov neeg siv ntawm lub moj khaum, kev teeb tsa nrog Bootstrap yog qhov kev daws teeb meem zoo rau cov neeg tsim khoom hauv lub vev xaib. Nws tso cai rau koj los tsim ib qho yooj yim thiab intuitive interface nyob rau lub sij hawm luv luv thiab tsis muaj kev siv zog ntau.

bootstrap qhib modal qhov rai
bootstrap qhib modal qhov rai

Kev tsim qauv

Ib qho ntawm cov qauv nrov tshaj plaws uas tso cai rau tus tsim qauv tsim cov vev xaib zoo thiab cov ntawv thov yam tsis siv sijhawm thiab siv zog rau nws yog Bootstrap 3. Lub qhov rais modal muab cov neeg siv nrog cov txheej txheem yooj yim ntawm cov cuab yeej pub dawb. Nrog nws, koj tuaj yeem siv JavaScript, CSS, html. Cov software no tau tsim los ntawm Twitter thiab muaj ntau yam nta thiab cov txiaj ntsig. Lub moj khaum tau tsim rau cov khoom siv txawb, yog li nws daim phiaj yog tsim rau cov ntxaij vab tshaus me. Niaj hnub no, Bootstrap 3 kuj tseem siv rau cov khoom siv dav dav. Muaj tsuas yog ib qho kev teb kab sib chaws hauv qhov kev pab cuam, uas tau txuas ntxiv los ntawm cov tuam txhab.

Lub moj khaum los nrog fonts. Lawv yog siv los ua icons. Hauv qhov kev pab cuam no, cov neeg tsim qauv twb tau ua haujlwm nrog vector fonts thiab duab, uas tuaj yeem hloov pauv ntawm qhov xav tau. Qhov peculiarity ntawm Bootstrap 3 yog tias nws tsis txhawb cov browser qub. Lub tswv yim ntawm kev tsim qauv yog yooj yim: qhov chaw cia li hloov mus rau qhov screen loj, tsis hais lub cuab yeej twg los ntawm tus neeg siv nkag mus rau nws. Kev tsim qauv xav tau kev paub tshwj xeeb thiab kev txawj ntse.

Ua haujlwm nrog Bootstrap

Ua ntej koj pib tshawb txog Bootstrap, rub nws dawb. Tom qab rub tawm thiab tshem tawm tom qab, tus neeg siv yuav tau txais peb lub folders uas muaj cov qauv, cov ntawv sau thiab cov cim fonts. Tag nrho cov no yog Bootstrap. Koj tuaj yeem qhib lub qhov rais modal tom qab tsim ib daim nplaub tshev nrog lub npe ntawm lub moj khaum. Hauv nws, koj yuav tsum tsim cov ntaub ntawv khoob "ndex.html". Hauv qhov rub tawm software, xaiv tag nrho "fonts" nplaub tshev thiab "bookstrap.css" style los ntawm cov ntawv tais ceev tseg. Tsis txhob hnov qab "bootstrap.js" tsab ntawv ib yam. Tsim ib daim nplaub tshev zoo sib xws nrog lub npe "css" hauv cov ntawv tais ceev tseg uas twb muaj lawm, tso "bootstrap.min.css" hauv nws. Ua lwm "css" nrog ib qho khoob "style.css" cov ntaub ntawv. Koj yuav xav tau nws ntxiv rau koj tus kheej style.

Thaum txhua yam tsim nyog tau tsim, ua haujlwm ntxiv tsuas yog ua nrog "ndex.html". Yog tias koj tsis xav sau cov lis dej num manually, xa mus rau cov ntaub ntawv npaj ua html skeleton. Luam thiab paste cov cai rau hauv cov ntaub ntawv. Cov qauv, cov tsev qiv ntawv thiab cov ntawv yuav txuas nrog hauv cov pob txha tsim. Ua ntej lub cev tag, tsis txhob hnov qab suav nrog lub tsev qiv ntawv "jQuery", thiab tom qab - "js" tsab ntawv.

ntau bootstrap modals
ntau bootstrap modals

Grid

Lub qhov rais Bootstrap modal yog siv los tsim ib qho chaw zoo nkauj. Nws muaj ib tug header, lub cev, sab kem thiab footer. Yuav kom txhua yam kom pom tseeb, nws yog ib qho tsim nyog los xam qhov dav ntawm txhua lub caij raws li feem pua ntawm cov neeg qhwv. Lub footer thiab header ntawm qhov chaw yuav tsum yog 100% dav, lub cev thiab sab kab tuaj yeem me dua.

Daim phiaj Bootstrap tsuas yog xav tau los teeb tsa qhov dav xav tau rau cov blocks. Kev ua haujlwm ntawm daim phiaj xwm txheej tshwm sim nrog kev pab ntawm lub rooj uas muaj kab thiab kab. Ib daim phiaj tuaj yeem ua rau hauv lwm daim phiaj xwm tsis txwv lub sijhawm. Yog tias qhov chaw ntawm lub xaib tau ua nrog nws, tsis tas yuav sau cov lus nug hloov kho koj tus kheej. Ntxiv rau daim phiaj, lub qhov rais modal muaj ntau yam ntxiv (cov ntawv qhia zaub mov, rooj, tabs, cov lus qhia).

bootstrap modal tsis ua haujlwm
bootstrap modal tsis ua haujlwm

Mustakes

Qee zaum ntau Bootstrap modals qhib tib lub sijhawm tuaj yeem ua rau muaj qhov yuam kev. Qhov no ua tau yog tias Windows ua tsis tauload html file kom raug. Lub xub ntiag ntawm qhov yuam kev qhia tias cov ntaub ntawv muaj kab mob malware lossis kab mob. Feem ntau, Bootstrap cuam tshuam txog qhov yuam kev tshwm sim thaum lub sijhawm thauj khoom ntawm cov kev pab cuam, lub khoos phis tawj, lossis tom qab ua qee yam haujlwm. Cov feem ntau yog cov cuam tshuam nrog lub qhov rais modal: "Yuam kev hauv cov ntaub ntawv", "Missing file", "Tsis pom", "Unable to load", "Failed to register", "Execution and loaderror". Lawv tuaj yeem tshwm sim thaum tus neeg siv teeb tsa ib qho program lossis nws twb tau ua haujlwm lawm, lossis thaum lub khoos phis tawj qhib thiab kaw. Nws yog ib qho tseem ceeb kom ua tib zoo kaw qhov muag ntawm qhov pom ntawm qhov yuam kev, vim qhov no yuav pab kom raug tshem tawm qhov ua rau lawv tshwm sim hauv Bootstrap. Lub qhov rais modal tsis ua haujlwm qee zaum vim yog hu tsis raug, uas tsis nyob ntawm qhov yuam kev sab hauv.

Pom zoo: