Bring your tabs to life with a simple plugin to toggle between content via tabs. This component required metro-tab-control.js
.
To make tabs tabbable, create a .tab-control
with unique ID for every tab and wrap them in .frame
.
<div class="tab-control" data-role="tab-control"> <ul class="tabs"> <li class="active"><a href="#_page_1">Tab 1</a></li> <li><a href="#_page_2">Other Tab</a></li> <li><a href="#_page_3"><i class="icon-rocket"></i></a></li> <li class="place-right"><a href="#_page_4"><i class="icon-cog"></i></a></li> </ul> <div class="frames"> <div class="frame" id="_page_1">...</div> <div class="frame" id="_page_2">...</div> <div class="frame" id="_page_3">...</div> </div> </div>
Now you can create tab control in tab control.
The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham.
Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit...
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus quis mollis arcu. Nam nibh nisi, tincidunt non tristique ut, venenatis quis sapien. Proin at sagittis magna, non pharetra nisi.
The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham.
The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham.
To activate tab-control with data-api you can add attribute data-role="tab-control"
to component.
<div class="tab-control" data-role="tab-control">...</div>
Call tab control manually with:
$('.tab-control').tabcontrol();
You can add tab content showing effect with effect
parameter.
<div class="tab-control" data-effect="fade[slide]">...</div>
$('.tab-control').tabcontrol({ effect: 'fade' // or 'slide' });
When tab switched, tab control triggered event change
. You can bind this event to additional manipulating with tab content.
$('.tab-control').tabcontrol().bind("tabcontrolchange", function(event, frame){...});
<script> $(function(){ $("#tab-with-event").tabcontrol().bind("tabcontrolchange", function(event, frame){ var id = $(frame).attr("id"); $(frame).html("Show in time " + (new Date()).getTime() + " frame id:"+id); }) }) </script>