How To
Infinite Scroll Results
2min
by default klevu template js contains elements for pagination and number of records per page this can easily be replaced with an infinite scroll using the configuration docid\ el9qchgznersiaeg e lu option to enable the resultinfinitescroll module javascript \<! add the following below the klevu js core script include > \<script type="text/javascript"> klevu({ theme { modules { resultinfinitescroll { quicksearch { enable true }, searchresultspage { enable true }, categorypage { enable true } } } } }) \</script> see an in action example and the source code on the klevu codesandbox disabling automated scroll to top the infinite scroll activation loads the additional records to template js using ajax style response in some website themes, the newly loaded array will shift the user to the top of the page the same effect can be witnessed using the template js default pagination if the user is in mid page view and selects an alternate pagination value the following example will disable the scrolltotop behavior in these instances for both landing and catnav scope please see after template render docid\ mfgw 8vqsnpinyqs19kjq section for details on this method of klevu js overriding \<! add the following below the klevu js core script include > \<script type="text/javascript"> klevu aftertemplaterender("landing,catnav", function(data, scope){ document body style minheight = '0'; const currentdocumentheight = document documentelement scrollheight; document body style minheight = '${currentdocumentheight}px'; scope kscope chains events keyup remove({name "scrolltotop"}); }); \</script>