I have a external Json file that displays images within the site. I need to limit the display to only 20 images then when you scroll down show the rest.
$(window).load(function() {
// url used to get the JSON data
var picarioAPI = "https://meno.picarioxpo.com/xpo/api/v1/designs/search/rca-designs?apiKey=9e8a809e10a1402ebb56907a4e7daeed&skip=0&take=1024";
$.getJSON(picarioAPI, function(json) {
var text = "";
for (var i = 0; i < json.values.length; i++) {
//alert(json.values[i].displayUrl);
text += '<div class="prod" style="float:left;"><a href="{{ product.url }}/collections/designs?designid=' + json.values[i].id + '&designWidth=' + json.values[i].width + '&designHeight=' + json.values[i].height + '&designName=' + json.values[i].name + ' &designThumb=' + json.values[i].storagePath + '"><img src="' + json.values[i].displayUrl + '"><p class="title">' + json.values[i].name + '</p></div>';
document.getElementById("design").innerHTML = text;
}
});
});
#design {
margin:20px;
}
#design img {
width:200px;
margin:10px;
max-height: 200px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<p id="design"></p>