Onclick show next divs

前端 未结 3 907
無奈伤痛
無奈伤痛 2021-01-29 08:49

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.

3条回答
  •  佛祖请我去吃肉
    2021-01-29 09:36

    Assign sets of 20 to css classes, and have your jQuery method show all in that class. You can have a global js variable track number of clicks, then if an if statement, show hide the appropriate sections:

    
    
    
    blah
    blah
    //in click event

提交回复
热议问题