I-WordPress: Ukusebenzisa i-jQuery Ukuvula i-LiveChat Window ngokucofa ikhonkco okanye iqhosha usebenzisa i-Elementor.

Ukusebenzisa i-jQuery ukuvula i-LiveChat Window Ngokucofa ikhonkco okanye iqhosha usebenzisa i-Elementor

Omnye wabathengi bethu uye Mlawuli, enye yezona ndawo ziqinileyo zokwakhiwa kwekhasi kwi-WordPress. Besisoloko sibancedisa ekucoceni iinzame zabo zokuthengisa ezingaphakathi kwezi nyanga zimbalwa zidlulileyo, sinciphisa uhlengahlengiso abaluphumezileyo, kunye nokufumana iinkqubo ezinxibelelana ngcono - kubandakanya nohlalutyo.

Umthengi uye LiveChat, inkonzo yencoko emnandi enokuhlanganiswa okuqinileyo kwe-Google Analytics kuyo yonke inyathelo lenkqubo yokuncokola. I-LiveChat ine-API enhle kakhulu yokudibanisa kwindawo yakho, kubandakanywa nokukwazi ukuvula ifestile yengxoxo usebenzisa isiganeko se-OnClick kwithegi ye-anchor. Nantsi indlela ekhangeleka ngayo:

<a href="#" onclick="parent.LC_API.open_chat_window();return false;">Chat Now!</a>

Oku kuluncedo ukuba uyakwazi ukuhlela ikhowudi engundoqo okanye ukongeza iHTML yesiko. Nge Mlawuli, nangona, iqonga itshixiwe phantsi ngenxa yezizathu zokhuseleko ukuze ungakwazi ukongeza i onCofa umcimbi kuyo nayiphi na into. Ukuba unalo msitho wokuClikha udityaniswe kwikhowudi yakho, awufumani naluphi na uhlobo lwempazamo… kodwa uya kubona ikhowudi icinyiwe kwisiphumo.

Ukusebenzisa uMphulaphuli we-jQuery

Omnye umda wendlela ye-onClick kukuba kuya kufuneka uhlele ikhonkco ngalinye kwindawo yakho kwaye wongeze loo khowudi. Enye indlela yokusebenza kukubandakanya umbhalo kwiphepha elo mamela ngonqakrazo oluthile kwiphepha lakho kwaye ikwenzela ikhowudi. Oku kunokwenziwa ngokukhangela nayiphi na ithegi yeankile ethile iklasi CSS. Kule meko, sikhetha ithegi ye-ankile kunye neklasi enegama openchat.

Ngaphakathi kwendawo engezantsi, ndongeza nje intsimi yeHTML yesiko kunye neskripthi esiyimfuneko:

<script>
document.addEventListener("DOMContentLoaded", function(event) {
  jQuery('.openchat a').click(function(){
    parent.LC_API.open_chat_window();return false;
  });
});
</script>

Ngoku, eso script sibanzi indawo ngoko nokuba liliphi iphepha, ukuba ndineklasi openchat ecofayo, iya kuvula ifestile yencoko. Kwinto ye-Elementor, sibeka nje ikhonkco kwi # kunye neklasi njenge openchat.

ikhonkco elementor

iiklasi zeseto eziphambili

Ewe, ikhowudi inokwandiswa okanye ingasetyenziselwa naluphi na uhlobo lomsitho ngokunjalo, njenge Umnyhadala woHlaziyo lukaGoogle. Ewe kunjalo, i-LiveChat inodibaniso olubalaseleyo kunye ne-Google Analytics eyongeza ezi ziganeko, kodwa ndizifaka ngezantsi njengomzekelo:

<script>
document.addEventListener("DOMContentLoaded", function(event) {
  jQuery('.openchat a').click(function(){
    parent.LC_API.open_chat_window();return false;
    gtag('event', 'Click', { 'event_category': 'Chat', 'event_action':'Open','event_label':'LiveChat' });
  });
});
</script>

Ukwakha indawo ngaphandle nge-Elementor kulula kakhulu kwaye ndincoma kakhulu iqonga. Kukho uluntu olukhulu, iitoni zezixhobo, kunye nokongezwa kwe-Elementor ezimbalwa ezomeleza izakhono.

Qalisa nge-Elementor Qalisa ngeLiveChat

Ukubhengezwa: Ndisebenzisa amakhonkco obulungu Mlawuli kwaye LiveChat kweli nqaku. Indawo apho siphuhlise khona isisombululo a Umenzi weTub eshushu kumbindi weIndiana.