Browse Source

tabs

master
rdrew 2 years ago
parent
commit
f6b1245008
  1. 38
      templates/content/node--islandora-rdm-dataset.html.twig

38
templates/content/node--islandora-rdm-dataset.html.twig

@ -40,8 +40,12 @@ set node_classes = [
</header> </header>
{% endif %} {% endif %}
<div{{ content_attributes.addClass('node-content clear') }}> <div{{ content_attributes.addClass('node-content clear') }}>
{#=============#}
{#Dummy Content#}
{#=============#}
<hr> <hr>
<h3>Rob's dummy content</h3> <h3>Rob's dummy content</h3>
{#Table#}
<table class="metadata"> <table class="metadata">
<tbody> <tbody>
<tr id="row_id"> <tr id="row_id">
@ -74,29 +78,29 @@ set node_classes = [
</tr> </tr>
</tbody> </tbody>
</table> </table>
{#/table#}
<!-- dummy tabs --> <!-- dummy tabs -->
<!-- Tab links --> <!-- Tab links -->
<div class="tab"> <div class="tab">
<button id="defaultOpen" class="tablinks" onclick="openCity(event, 'London')">London</button> <button id="defaultOpen" class="tablinks" onclick="openTab(event, 'Tab01')">Tab01</button>
<button class="tablinks" onclick="openCity(event, 'Paris')">Paris</button> <button class="tablinks" onclick="openTab(event, 'Tab02')">Tab02</button>
<button class="tablinks" onclick="openCity(event, 'Tokyo')">Tokyo</button> <button class="tablinks" onclick="openTab(event, 'Tab02')">Tab02</button>
</div> </div>
<!-- Tab content --> <!-- Tab content -->
<div id="London" class="tabcontent"> <div id="Tab01" class="tabcontent">
<h3>London</h3> <h3>Tab01</h3>
<p>London is the capital city of England.</p> <p>Adipisicing consectetur dolorem tempora quibusdam ad at! Eius consectetur consequuntur omnis tenetur repudiandae. Iure laudantium optio magni laboriosam rerum Commodi quisquam tempora eaque minima nemo! Distinctio earum dolores aliquid facere</p>
</div> </div>
<div id="Paris" class="tabcontent"> <div id="Tab02" class="tabcontent">
<h3>Paris</h3> <h3>Tab02</h3>
<p>Paris is the capital of France.</p> <p>Dolor quam quo vero perspiciatis vel. Odit ut delectus doloribus illum culpa? Nobis culpa aperiam omnis quae cupiditate ipsam libero iure vero. Unde sequi eligendi eaque eum repellendus Animi ullam.</p>
</div> </div>
<div id="Tokyo" class="tabcontent"> <div id="Tab02" class="tabcontent">
<h3>Tokyo</h3> <h3>Tab02</h3>
<p>Tokyo is the capital of Japan.</p> <p>Adipisicing ea dolorum eos excepturi nobis Ipsa officia accusamus omnis iure at Repudiandae quaerat ratione provident quos quae dolor Est voluptatibus aliquam fuga enim nostrum? Necessitatibus magni earum quo esse.</p>
</div> </div>
<!-- /dummy tabs --> <!-- /dummy tabs -->
@ -107,9 +111,11 @@ set node_classes = [
{{ content }} {{ content }}
</div> </div>
</article> </article>
{#==========#}
{#JS for Tabs#}
{#==========#}
<script> <script>
function openTab(evt, tabName) {
function openCity(evt, cityName) {
// Declare all variables // Declare all variables
var i, tabcontent, tablinks; var i, tabcontent, tablinks;
@ -126,7 +132,7 @@ function openCity(evt, cityName) {
} }
// Show the current tab, and add an "active" class to the button that opened the tab // Show the current tab, and add an "active" class to the button that opened the tab
document.getElementById(cityName).style.display = "block"; document.getElementById(tabName).style.display = "block";
evt.currentTarget.className += " active"; evt.currentTarget.className += " active";
} }

Loading…
Cancel
Save