jQuery UI & Tabs: Vertical tabs

This entry is part 2 of 7 in the series jQuery UI Tabs

jQuery UI Tabs – Vertical Tabs functionality

Click tabs to swap between content that is divided into logical sections.

<!doctype html>
<html lang='en'>
    <meta charset='utf-8'>
    <title>jQuery UI Tabs - Vertical Tabs functionality</title>
    <link rel='stylesheet' href='//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css'>
    <script src='//code.jquery.com/jquery-1.10.2.js'></script>
    <script src='//code.jquery.com/ui/1.10.4/jquery-ui.js'></script>
    <link rel='stylesheet' href='http://codecrawl.com/code/jqueryui/jqueryui_style.css'>
        $(function () {
            $('#tabs').tabs().addClass('ui-tabs-vertical ui-helper-clearfix');
            $('#tabs li').removeClass('ui-corner-top').addClass('ui-corner-left');
        .ui-tabs-vertical {
            width: 55em;

        .ui-tabs-vertical .ui-tabs-nav {
            padding: .2em .1em .2em .2em;
            float: left;
            width: 12em;

        .ui-tabs-vertical .ui-tabs-nav li {
            clear: left;
            width: 100%;
            border-bottom-width: 1px !important;
            border-right-width: 0 !important;
            margin: 0 -1px .2em 0;

        .ui-tabs-vertical .ui-tabs-nav li a {
            display: block;

        .ui-tabs-vertical .ui-tabs-nav li.ui-tabs-active {
            padding-bottom: 0;
            padding-right: .1em;
            border-right-width: 1px;
            border-right-width: 1px;

        .ui-tabs-vertical .ui-tabs-panel {
            padding: 1em;
            float: right;
            width: 40em;

<div id='tabs'>
        <li><a href='#tabs-1'>Pitbull</a></li>
        <li><a href='#tabs-2'>Sean Kingston</a></li>
        <li><a href='#tabs-3'>Taylor Swift</a></li>
    <div id='tabs-1'>
        <h2>Content heading 1</h2>

        <p>Pitbull is a Cuban–American recording artist and Latin Grammy winning rapper from Miami, Florida.</p>
    <div id='tabs-2'>
        <h2>Content heading 2</h2>

        <p>Sean Kingston pursued a music career and debuted in 2007 with the album Sean Kingston.</p>
    <div id='tabs-3'>
        <h2>Content heading 3</h2>

        <p>Taylor Swift, raised in Wyomissing, Pennsylvania. She moved to Nashville, Tennessee at the age of

        <p>She is known for her narrative songs about her personal experiences.</p>

Try The Code
Series Navigation<< jQuery UI & Tabs: Simple tabs
jQuery UI & Tabs: Collapsible content >>

Leave a comment

Leave a Reply