JQuery modal window - nws yog dab tsi rau thiab yuav ua li cas rau nruab nws

Cov txheej txheem:

JQuery modal window - nws yog dab tsi rau thiab yuav ua li cas rau nruab nws
JQuery modal window - nws yog dab tsi rau thiab yuav ua li cas rau nruab nws
Anonim

txhawm rau nrhiav cov lus teb rau koj cov lus nug, qee zaum koj yuav tsum siv sijhawm ntau, tshwj xeeb tshaj yog tias, raws li kev tsim lub vev xaib, tus neeg uas tsis paub tshwj xeeb hauv cov teeb meem no tau txiav txim siab los tsim lub vev xaib. ntawm nws tus kheej. Lub qhov rais jquery modal tuaj yeem yog ib txoj haujlwm nyuaj heev.

Koj tuaj yeem pom ntau lub qhov rais zoo li no hauv Is Taws Nem. Nws zoo nkaus li tias koj tsuas yog yuav tsum luam lawv thiab muab tso rau hauv koj qhov chaw … Txawm li cas los xij, tsis yog txhua yam yooj yim heev. Raws li hmoov zoo yuav muaj nws, muaj qee qhov kev nthuav dav uas ua rau txhua yam qeeb, thiab nws tsis tuaj yeem daws txoj haujlwm, vim tias tsis muaj kev paub tsim nyog rau qhov no. Yog li ntawd, tsis yog tam sim thab plaub lub qhov rais modal ntawm jQuery nrog ntau yam nthuav dav uas nyuaj rau kev siv, nws yog qhov zoo dua los pib nrog lub qhov rais me me, yooj yim tshaj plaws modal yam tsis muaj teeb meem tsis tsim nyog.

Yog tias muaj ib qhov blog nyob rau hauv wordpress, ces txhua yam yog yooj yim heev, thiab feem ntau tsis muaj teeb meem, vim nws twb muaj ntau cov kev npaj npaj txhij - ntau yam pop-up modules. Tab sis kuj tseem muaj cov kev xaiv sib txawv uas koj yuav tsum "sculpt" lub qhov rais modal koj tus kheej lossis tig mus rau cov kev pabcuam them nyiaj ntawm cov kws tshaj lij. Raws li koj paub, tsis muaj leej twg xav them, tshwj xeeb tshaj yog thaum nws zoo nkaus li tias koj tsuas yog xav tau mus rau hauv qab ntawm qhov teeb meem, thiab txhua yam yuav tig tawm zoo nkauj sai thiabdawb kiag li.

Ib lub qhov rais jquery modal yog xav tau los tso saib cov ntsiab lus uas mus nrog rau cov ntaub ntawv ntawm nplooj ntawv thiab ntxiv rau nws.

jQuery - yog dab tsi?

Rau qhov kev nkag siab tiav, yog tias ib tus neeg tsis paub, ces jquery yog lub tsev qiv ntawv JavaScript, thiab tom kawg, tig, txhais tau hais tias ib daim code uas tau kos rau hauv cov lej ntawm nplooj ntawv web thiab tso cai rau koj ua tiav. Cov teebmeem sib txawv uas tsis tuaj yeem siv tau hauv HTML thiab CSS. Ib qho piv txwv ntawm xws li ib daim code yuav yog hnub tam sim no lossis lub sijhawm tshwm sim ntawm nplooj ntawv.

Cov neeg tsim tawm ntawm lub tsev qiv ntawv muaj lub vev xaib raug cai, uas tau txhim kho thiab hloov kho tas li, nrog rau cov ntawv tshiab uas muab cov tsev qiv ntawv tshiab.

Qhia jquery tias koj xav tau qhov no lossis qhov txiaj ntsig ntawd, muaj CSS cov lus nrog cov ntawv txheeb.

CSS language

CSS txhais tau tias Cascading Style Sheets. Tam sim no nrhiav tsis tau ib qhov chaw hauv Internet uas tsis siv hom lus no.

Li no, hauv qhov rais modal, jquery thiab CSS yog yuav luag indispensable thiab indispensable. Yog li, yog tias jquery tsis suav nrog, koj yuav tsum ua qhov no.

Yuav ua li cas, cov hauv qab no tau muab tso rau hauv lub taub hau:

jQuery
jQuery

modals yog dab tsi?

Ib qho yooj yim jquery modal uas tshwm sim thaum lub vev xaib thauj khoom tuaj yeem pab tau kom tau txais ntau cov thwjtim. Lub qhov rais yuav tshwm sim thaum nplooj ntawv qhib. Nws tsis cuam tshuam ntau thiab tsis zoo li yuav ntshai leej twg, txij li thaum qhov tsis xis nyob me ntsis nws yooj yim raukaw, thiab khawm kaw yuav muaj ncuav qab zib, thiab thaum koj nyem rau ntawm nws, lub qhov rais modal ploj lawm yuav tsis rov tshwm sim dua.

Pop-up window

Ib lub qhov rais jquery popup uas tsuas yog tshwm sim ib zaug ib nplooj ntawv yog qhov hloov pauv ntawm modal windows.

Yuav kom siv tau, yuav tsum tau ua ntau kauj ruam.

Koj tuaj yeem siv cov plugins tshwj xeeb rau lub qhov rais modal. Nws yog qhov zoo tshaj rau rub tawm lawv los ntawm cov chaw tsim tawm xws li arcticModal. Nws txuas raws li hauv qab no:

jQuery modal qhov rais
jQuery modal qhov rais

Yog tsis muaj qhov rais styling, ib qho ntawm cov qauv plugin cov ntsiab lus yuav zoo li no:

jQuery yooj yim modal qhov rais
jQuery yooj yim modal qhov rais

Tom ntej, lub ncuav qab zib plugin txuas nrog:

jQuery modal qhov rais
jQuery modal qhov rais

Sau HTML code uas muab cov ntaub ntawv rau tus neeg siv:

jQuery modal qhov rais
jQuery modal qhov rais

Cov chav kawm arctimonial-kaw teev hauv cov cai txhais tau hais tias jQuery modal qhov rai yuav kaw nrog nws.

Tom ntej los ntawm tsab ntawv kawg:

jQuery popup modal
jQuery popup modal

Qee qhov ntsuas siv txhais tau li hauv qab no:

closeOnOverClick: yuav txiav txim seb lub qhov rais kaw thaum lub overlay clicked.

CloseOn Esc: txhais tau tias nyem rau Esc.

Expires: Qhia lub sijhawm uas lub ncuav qab zib yuav raug khaws cia. Nyob rau hauv lub tswv yim version, lub sij hawm no yuav yog rau caum hnub, uas yog, lub qhov rais yuav tsis tshwm sim rau ob lub hlis. Cov ncuav qab zib tau hloov kho rau txhua qhov kev mus ntsib.

Kawm yuav ua li cas rau nruab ntawm kojjQuery modal qhov rais ntawm qhov chaw, koj tuaj yeem txav mus rau ntau txoj kev xaiv yog tias tsim nyog. Rau qhov no, ntau hom CSS tau ntxiv, thiab lub qhov rais yuav dhau los ua qhov sib txawv ntawm qhov rais modal ntawm lwm qhov chaw.

Fantasy thiab kev xav yuav pab kom cov neeg siv khoom nce ntxiv ua tsaug rau cov kev daws teeb meem zoo li no, thiab cov khoom siv tau zoo hauv cov khw muag khoom online tuaj yeem nce muag ntau zaus. Yog li ntawd, lub sij hawm siv rau programming thiab txhim kho lub qhov rais yuav raug tsim nyog thiab yuav twv yuav raug them!

Type of modal windows

Modal windows tuaj yeem pop-up thaum koj nyem rau ntawm lub pob sib txuas lossis thauj khoom nrog rau nplooj ntawv thiab tshwm sim tam sim ntawd thaum thauj khoom. Tej zaum lawv yuav tsis tshwm sim thaum kaw rau lub sijhawm yog tias lub ncuav qab zib tau teeb tsa, raws li hauv cov piv txwv tau piav qhia saum toj no, lossis lawv tuaj yeem tshwm sim txhua zaus cov nplooj ntawv thauj khoom. Muaj cov qhov rais modal uas tau kho nyob rau hauv ib qho chaw thiab nyob twj ywm rau ntawm nws, txawm tias muaj kev txav ntawm nplooj ntawv, thiab tuaj yeem ua tau zoo thaum lub qhov rais muaj cov ntaub ntawv txuas nrog, thiab tus neeg siv dhau los ntawm nws. Tom qab ntawd tsuas yog lub qhov rais yuav hloov kho, thaum nplooj ntawv qub tseem tsis hloov pauv.

Pom zoo: