Sesiqeda Kanjani Isikhathi Sethu Sokulayisha Ikhasi ngamasekhondi ayi-10

Isivinini nezenhlalo kubonakala kungasebenzi ndawonye uma kukhulunywa ngewebhusayithi enhle. Sithuthele isiza sethu saya ku- ligcina uthi lokuphotha luzungeza (isixhumanisi esihambisanayo) futhi yathuthukisa kakhulu ukusebenza nokuqina kwesayithi lethu. Kepha ukwakheka kwethu kwesiza - ngonyawo ononile okhuthaze imisebenzi yethu yezenhlalo ku-Facebook, Twitter, Youtube nakuPodcast yethu - kunciphise isiza sethu sakhasa.

Kwakukubi. Ngenkathi ikhasi elikhulu lilayisha ngemizuzwana emi-2 noma ngaphansi, isiza sethu besithatha imizuzwana engaphezu kwe-10 ukuthi ikhasi liqede. Inkinga kwakungeyona i-WordPress noma i-Flywheel, inkinga kwakuyizinto zonke ezisebenzisanayo esizilayishe kusuka kwezinye izinsiza… Amawijethi we-Facebook ne-Twitter, izithombe zokubuka kuqala ze-Youtube, uhlelo lwethu lwePodcast, angikwazi ukulawula ukuthi zilayisha kancane kangakanani. Kuze kube manje.

Uzobona manje ukuthi amakhasi ethu alayisha cishe kumasekhondi ama-2. Sikwenze kanjani lokhu? Singeze isigaba esinamandla kunyaweni wethu olayisha kuphela lapho umsebenzisi egoqa aze afike kulelo phuzu. Skrolela ezansi kwekhasi lethu kusiphequluli (hhayi iselula, uhlelo lokusebenza noma ithebhulethi) futhi uzobona isithombe sokulayisha sithatha:

Ukulayisha

Sisebenzisa i-jQuery, empeleni asilayishi isisekelo sekhasi kuze kube yilapho othile eskrolela lapho. Ikhodi empeleni ilula impela:

$ (window) .scroll (function () {if (jQuery (document) .height () == jQuery (window) .scrollTop () + jQuery (window) .height ()) {if ($ ("# placetoload") umbhalo (). ubude <200) {$ ("# okungeziwe"). umthwalo ('[indlela ephelele yekhasi yokulayisha]');}}});

Lapho umsebenzisi eskrolela phansi kwekhasi, i-jQuery go ikhipha okuqukethwe kwekhasi lendlela ebekiwe futhi ikulayishe ngaphakathi kwe-div oyikhethile.

Ngenkathi isayithi lingasazuzi kokuqukethwe okulayishwe lapho (ngoba injini yokusesha ayikufuni), siyaqiniseka ukuthi ijubane lekhasi lizosiza ukukala kwethu, ukwabelana nokubandakanya okuningi kunokuthola othile ulinde ngokungenasineke ikhasi lethu ukuthi lilayishe kancane kancane. Okuhle kunakho konke, ikhasi lisenazo zonke izinto esifuna ukuzibandakanya nezivakashi zethu… ngaphandle kokudela isivinini sekhasi.

Sisenomsebenzi okufanele siwenze… kepha siya lapho!

UCABANGANI?

Le sayithi isebenzisa i-Akismet ukunciphisa ugaxekile. Funda ukuthi idatha yakho yokuphawula isetshenziswa kanjani.