Tutorial on Creating HTML5 and JavaScript Load More Button

preview_player
Показать описание
In this video tutorial I'm sharing about how to create "Load More" button in JavaScript to show partial contents of an array variable.

Please note that in this technique first I retrieve all the information from server at single shot and store it in single array variable. So load more mechanism is happening on client side, not each time calling server to return partial contents.

Рекомендации по теме
Комментарии
Автор

Excellent stuff, thank you !
I was able to combine this with bootstrap cards ans jquery fadeIn effect to use it in a custom gallery.
In initial version of this code, the load button requires one extra click after displaying all content to disappear. Here's my tweaked version of the code :

var currentindex = 0
function loadmore(){
var maxresult = 2
for(var i = 0; i < maxresult;){


i++;
>= (items.length)){


}
}
currentindex += maxresult
}

olliegobo
Автор

Stunning! Thank you. That's it what I need.

uktamhudoyarov
join shbcf.ru