You've probably seen or used a tab control in the past - the pivot control is a sexy descendant of the tab control.
This widget, adapted from the jqMetro project, allows developers to make their web content more interactive with a bit of markup and some Javascript
<script type="text/javascript" src="/ajax.aspnetcdn.com/ajax/jquery/jquery-1.7.2.min.js"></script> <script type="text/javascript" src="/scripts/jquery.metro.js"></script>Then define the the DOM for the tabs. The
metro-pivot
represents the container for the control, and the pivot-item
represents each item in the collection.
<div class="metro-pivot"> <div class="pivot-item"> <h3>tab 1</h3> <p>content</p> </div> <div class="pivot-item"> <h3>tab 2</h3> <p>content</p> </div> </div>Then add this script to the bottom of the page: $(function () { $("div.metro-pivot").metroPivot(); }); And that's it.
var defaults = { animationDuration: 350, headerOpacity: 0.25, fixedHeaders: false, headerSelector: function (item) { return item.children("h3").first(); }, itemSelector: function (item) { return item.children(".pivot-item"); }, headerItemTemplate: function () { return $("<span class='header' />"); }, pivotItemTemplate: function () { return $("<div class='pivotItem' />"); }, itemsTemplate: function () { return $("<div class='items' />"); }, headersTemplate: function () { return $("<div class='headers' />"); }, controlInitialized: undefined, selectedItemChanged: undefined }; $(function () { $("div.metro-pivot").metroPivot(defaults); });
Topping bear claw lemon drops. Cake powder gingerbread. Powder halvah powder danish. Cookie gingerbread muffin wypas cake marzipan dessert. Pastry jelly beans tootsie roll dessert wypas gingerbread pastry candy toffee. Sweet roll cupcake halvah. Gingerbread cotton candy tiramisu muffin carrot cake chocolate sweet roll donut. Applicake toffee halvah toffee dragée toffee candy canes sesame snaps cheesecake. Sweet powder lollipop apple pie candy halvah chupa chups croissant. Jelly beans bear claw soufflé apple pie. Gummies ice cream marzipan tootsie roll wypas carrot cake. Bonbon lemon drops candy gummi bears lemon drops lollipop. Powder caramels jelly.