Using jQuery display 8 li at one time
it开发者_如何学编程s a simple one but I am not able to get it right.
I have a UL with some 80 li inside it, I want to display 8 at one time, if someone press next then next 8. I google it but still not able to find someone like it.
Regards
There are a number of jQuery pagination modules for this sort of thing.
Try $('ul > li").hide().find(":gt(0):lt(8)").show()
then on the next page click you do $('ul > li").hide().find(":gt(8):lt(16)").show()
Another way you can do $('ul > li").hide().slice(0, 8).show()
精彩评论