I am struggling to implement a tab system with jquery (Not paginate system), it will be working as like as carousole
this is the snippet:
<div class="tab">
<p>Tab 1</p>
</div>
<div class="tab">
<p>Tab 2</p>
</div>
<div class="tab">
<p>Tab 3</p>
</div>
<div class="tab">
<p>Tab 4</p>
</div>
there above can be as much data as possible that comes from backend, there not only 4 tabs.
So I am trying to achieve, when page load, there will be the first two data/tab will be visible. when users click on the 2nd tab, there should 2nd tab and 3rd tab visible, so that user can click on 3rd tab to navigate 4th tab. like if if user click on 4th tab, there should be visible 4th and 5th tab. likewise, every next tab should act same.
For example, when page loaded,
the web will show lie this below
tab 1 | tab 2
so if i click on tab 2
it should show like this:
tab 2 tab 3
and if then click on tab 3
it should show like this:
tab 3 tab 4
so if i click on tab 4
it should show
tab 4 tab 5
likewise, every next tab should behave sam way.
Can anyone please help me to get it done with jquery?
I just tried a lot but I failed in every attempt