Panel Stack
Usage notes
Panel stacks are used to group fields together.
Default
Toggle markup
<coral-panelstack id="panel-well">
<coral-panel selected="" class="coral-Well">Panel 0: Aenean faucibus ornare laoreet. Cras luctus purus.</coral-panel>
<coral-panel selected="" class="coral-Well">Panel 1: Lorem ipsum dolor sit amet.</coral-panel>
<coral-panel class="coral-Well"> Panel 2: Sed eget eros sit amet nulla ultricies.</coral-panel>
<coral-panel class="coral-Well">
Panel 3: Fusce nec ante non nibh mollis mollis mollis vitae dui. Vivamus tristique nunc lacus, a placerat orci dapibus vel. Sed eget eros sit amet nulla ultricies scelerisque.
</coral-panel>
<coral-panel class="coral-Well">Panel 4: Aenean faucibus ornare laoreet. Cras luctus purus.</coral-panel>
</coral-panelstack>
<a href="#" class="coral-Link cycle" data-target="panel-well">Next</a>
<script>
window.addEventListener('load', function() {
Coral.events.on('click', '.cycle', function(event) {
event.preventDefault();
var panel = document.getElementById(this.dataset.target);
var items = panel.items.getAll();
var selectedItem = panel.selectedItem;
var next = selectedItem === items.slice(-1)[0] ? items[0] : items[items.indexOf(selectedItem) + 1];
next.setAttribute('selected', '');
});
});
</script>