I tried to add an automatic click on the link "Download more", but after downloading manually automatically downloads. I am stuck on this. If anyone knows a solution, please help.
<?php if( $next_link !== false ):?>
<div class="sp-load-more text-center" >
<a href='#' title="Load more result" data-url="<?php echo $next_link;?>" onclick="return doko.BuSfw16AlL(this, {container: '#search-results', rc : '.sp-load-more'})">
<span id="l-more" > Load More <i class="fa fa-angle-down fa-lg"></i> </span>
</a>
</div>
<?php else:?>
<div class="panel sp-box sp-load-more">
<div class="panel-body">
<span>-- End of Result --</span>
</div>
</div>
<?php endif; ?>
<script >
$(function(){
$(document).scroll(function (e) {
var intBottomMargin = 300;
if ($(window).scrollTop() >= $(document).height() - $(window).height() - intBottomMargin) {
$("#l-more").click();
}
});
});
</script>
source
share