Vertical Tabs Using JQuery

Very often you have seen jquery UI tabs used horizontally, like in the following image. But easily we can create Vertical Tabs in our project?

Vertical Tabs

How to create Vertical Tabs Using JQuery?

Here I will explain how to create a vertical tabs using jQuery.
Verticals Tabs

When we create Vertical Tabs, we have to think about three things. We will see the steps one by one

First is HTML required for the Vertical Tabs using jQuery

<div id="verticaltab">
       <li class="tabs selected"><a href="#">Tab One</a></li>
       <li class="tabs"><a href="#">Tab Two</a></li>
       <li class="tabs"><a href="#">Tab Three</a></li>
       <li class="tabs"><a href="#">Tab Four</a></li>
      <h4>This is the first tab</h4>
      <p>Content Goes here..</p>
      <h4>This is the second tab</h4>
      <p>Content Goes here..</p>
      <h4>This is the Third tab</h4>
      <p>Content Goes here..</p>
      <h4>This is the Fourth tab</h4>
      <p>Content Goes here..</p>

Here ‘ul’ part is the navigation for the content under each vertical tabs. Content goes inside the div tags.

Second is CSS required for the Vertical Tabs

We will add the necessary css for making the alignment and look and feel of the Vertical Tabs.

#verticaltab {
            margin: auto;
            width: 800px;
            height: 100%;
        #verticaltab > ul > li {
            width: 110px;
            height: 40px;
            background-color: #fff !important;
            list-style-type: none;
            display: block;
            text-align: center;
            margin: auto;
            padding-bottom: 10px;
            border: 1px solid #cdcdcd;
			border-bottom: 0;
            position: relative;
            border-right: none;
		#verticaltab > ul > li a { 
			font-size: 13px;
			line-height: 45px;
			text-decoration: none;
			color: #0da2be;
			font-weight: bold;
		#verticaltab > ul > li.selected a, #verticaltab > ul > li a:hover {
			color: #2F4F4F;
		#verticaltab > ul > li.tabs {
            background: #F0FFF0;
        #verticaltab > ul > li.selected {
            z-index: 10;
            background-color: #fafafa !important;
            position: relative;

        #verticaltab > ul {
            float: left;
            width: 110px;
            text-align: left;
            display: block;
            margin: auto 0;
            padding: 0;
            position: relative;
        #verticaltab > div {
            background-color: #fafafa;
            margin-left: 110px;
            border: 1px solid #ddd;
            min-height: 500px;
            padding: 12px;
            position: relative;
            z-index: 9;
            border-radius: 0 20px 20px 20px;
        #verticaltab > div > h4 {
            color: #2F4F4F;
            font-size: 1.2em;
            padding-top: 5px;
            margin-top: 0;
        #verticaltab > div p { font-size: 0.9em; color: #7f7f7f;}

Third is jQuery required for the Vertical Tab

$(function() {
            var $items = $('#vtab>ul>li');
            $items.mouseover(function() {

                var index = $items.index($(this));

Just copy this code for Vertical Tabs and past in your page and jquery plugin and check the vertical tabs working in your page.

You can also download the code for vertical Tabs here

label, , , , , , , , , , , , , , , , , , ,

About the author

Add a Comment

Your email address will not be published.