Ntau lub vev xaib niaj hnub no muaj cov khoom qub. Ib qho ntawm cov ntsiab lus yog pop-up windows nyob rau hauv uas koj tuaj yeem tso ntau cov ntaub ntawv muaj txiaj ntsig, tshaj tawm, tswj hwm, chaw xaiv tsa, thiab lwm yam. Nws yog qhov yooj yim heev los tsim cov popup zoo li - siv cov tsev qiv ntawv jQuery.
Cov Lus Qhia
Kauj ruam 1
Ntaus cov cim npe rau koj nplooj ntawv nplooj ntawv uas ntxiv rau chav qiv jQuery. Cov ntawv cim no zoo li cov qauv:
tsab ntawv src = "jQuery.js" / tsab ntawv
tsab ntawv src = "interface.js" / tsab ntawv
Kauj ruam 2
Ntxiv css code nyob rau hauv stylesheet rau style popup. Qhia kom meej cov tsis xws li chaw, qhov siab, dhau, yav dhau-duab, keeb kwm yav dhau los-ua haujlwm, tom qab rov ua dua, hla dhau, tso tus cim thiab lwm yam uas koj xav tau rau kev cim. Cov kev txwv no tseem tuaj yeem tsim tsa rau hauv taub hau, yog tias koj tsis muaj lub ntsiab cai ntawm kev faib cov ntawv tshwj xeeb rau cov qauv hauv koj qhov haujlwm ua haujlwm. Koj tuaj yeem sau cov lej hauv lwm txoj kev, siv ntau cov cim npe. Feem ntau muaj ntau txoj hauv kev los sau cov qhov rai ntab.
Kauj ruam 3
Khaws cov cai rau qhov txuas mus rau popup mus rau hauv lub cev ntawm nplooj ntawv, thiab piav qhia tsab ntawv nws tus kheej rau kev qhib cov popup. Piav qhia txoj haujlwm ua haujlwm hu rau lub qhov rai siv cov qauv qhia ua haujlwm (), TransferTo (), khi () thiab lwm tus. Sim sau cov lus piav qhia me me rau koj tus kheej ib sab ntawm txhua txoj haujlwm, kom tsis txhob muaj kev ntxhov siab nyob hauv txoj cai, zoo li koj tuaj yeem cuam tshuam kev ua haujlwm ntawm tag nrho cov kab ke.
Kauj ruam 4
Tshawb cov code rau kev yuam kev thiab qhib nplooj ntawv hauv browser kom pom qhov tshwm sim ntawm koj kev ua haujlwm. Rau lub qhov rais pop-up yuav tshwm sim, koj yuav tsum nyem rau ntawm kev tsim qhov txuas. Yav tom ntej, koj tuaj yeem muab qhov tsis siv neeg pom ntawm lub qhov rai pop-up. Cov neeg tsim tawm yuav tsum muaj ntau tus yam ntxwv, xws li muaj peev xwm ua kom luas thiab poob, txo qis, ncab, thiab tau kawg, kaw. Tag nrho cov cwj pwm no yuav tsum tau piav qhia hauv tsab ntawv popup. Ua cov qhov rai ntab tsis yog qhov nyuaj, qhov tseem ceeb yog kom paub qhov pib ntawm lub cajmeem, txij li koj xav tau kev paub tshwj xeeb los sau cov cai kom raug.