I have 1000 divs and 20 of them are visible and remaining are hidden.
In the onClick jquery event, I want the next 20 divs to become visible and so on.
If you're using jquery, you can use the .slice()
method.
http://api.jquery.com/slice/
Something like:
$('button').click(function(e){
var divs = $('.mydivs');
divs.hide().slice(0, 20).show(); // 0 is the starting index
});
You'd just need to figure out the logic to determine what your starting index is.
I don't have a non-jquery solution, maybe someone else could help on that front.