Puas yog nyem qhov xwm txheej ua haujlwm ntawm txawb?
Puas yog nyem qhov xwm txheej ua haujlwm ntawm txawb?

Video: Puas yog nyem qhov xwm txheej ua haujlwm ntawm txawb?

Video: Puas yog nyem qhov xwm txheej ua haujlwm ntawm txawb?
Video: 3 lub cim uas qhia tias peb kev ntseeg tuag lawm 2024, Tej zaum
Anonim

Tej zaum koj yuav tau hla cov xwm txheej thaum jQuery nyem qhov xwm txheej mloog ua haujlwm zoo ntawm desktop tab sis nws tsis tua mobiles , ntsiav tshuaj thiab lwm yam khoom siv kov. Qhov no yuav tshwm sim thaum lub xwm txheej tsis txuas rau ib qho chaw thauj tog rau nkoj tab sis rau qee yam khoom, zoo li div.

Tsis tas li ntawd, onClick puas ua haujlwm ntawm cov khoom siv txawb?

1 Teb. Yog lawm yuav ua haujlwm . Qhov no tau teb ntawm no: Yuav onClick xwm txheej ua haujlwm ntawm kov ntawm lub vijtsam kov cov khoom siv ?

Ib yam li ntawd, qhov kev tshwm sim nyem yog dab tsi? Cov nyem qhov xwm txheej hluav taws kub thaum tus neeg siv nyem rau ntawm lub caij LOSSIS qhib lub caij los ntawm lwm txoj kev (piv txwv li cov keyboard). Nws yog JavaScript tseem ceeb tshaj plaws xwm txheej . Lwm tus xwm txheej ntawm nplooj ntawv no yog nruj me ntsis subiary. mus down. Hluav taws kub thaum tus neeg siv depresses tus nas khawm.

Tsis tas li ntawd, MouseDown puas ua haujlwm ntawm txawb?

Kev soj ntsuam MouseDown ntawm Dektop thiab TouchStart rau Txawb Cov khoom siv. Peb xav tau qhov no vim MouseDown Tsis txhob tua hluav taws ntawm cov khoom siv kov thiab rov ua dua TouchStart yeej tsis tshwm sim ntawm cov cuab yeej siv tus nas pointer.

Puas yog nyem qhov xwm txheej npuas?

Qhov ntawd yog :rau a nias ntawm

tus xwm txheej thawj zaug mus txog ntawm cov poj koob yawm txwv txoj hlua mus rau lub caij (ntev ntes), ces nws mus txog lub hom phiaj thiab ua rau muaj (lub hom phiaj), thiab tom qab ntawd nws nce mus ( npuas theem), hu rau tus tuav ntawm nws txoj kev.

Pom zoo: