How to display div in js order

how to use js code in html to display hidden div in sequence
it is better to have special effects

Feb.28,2021

the simplest and most practical solution / idea (for native): add keywords / sequence numbers (such as data-view= "0") to the div you want to display sequentially and insert them into an array, and then for loop this array binding event, which uses setTimeout to display your delay (the second parameter is your delay time, which can be calculated by I), so that it can be displayed in order. It is convenient to use css3 transition or animate to achieve special effects.


first of all, I understand what you said. Your html code actually has all of it, but it doesn't show it. Now you need to display them one by one through js, right? If this is the case, the logic is relatively simple, first you get the set of elements, then loop through them, and unhide them one by one. Refer to the code obj.css ('display',''); just unhide the attribute. If you want special effects according to your needs, just modify obj.css ('display',''); to the special effects you want.

Menu