Simply add tabs.
composer require agencenous/jquery-tabs
<style rel="stylesheet" href="/vendor/agencenous/jquery-tabs/jquery-tabs.css"/>
<script src="/vendor/agencenous/jquery-tabs/jquery-tabs.js"/>
<div class="content">
<section>
<h3>Section 1</h3>
<p>Somme content</p>
</section>
<section>
<h3>Section 2</h3>
<p>Somme content</p>
</section>
<section>
<h3>Section 3</h3>
<p>Somme content</p>
</section>
</div>
And then, just instanciate:
jQuery('.content').createTabs({
children: 'section',
childrenTitle: 'h3'
});
- hideUntilLast
- prevText,
- nextText,
- prevClass,
- nextClass
Full example
jQuery('#form').createTabs({
children: 'fieldset',
childrenTitle: '.tab-title',
hideUntilLast: 'input[type=submit]',
prevText: '« back',
nextText: 'Next »',
prevClass: 'btn',
nextClass: 'btn'
});
jQuery('#form')
.on('tab_ready', function(){
console.log('READY!');
})
.on('tab_change', function(){
console.log('TAB CHANGED!');
})
.createTabs();