Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7059683
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:15:43+00:00 2026-05-28T04:15:43+00:00

I am using tabs in JQuery mobile navbar as tabs as given in the

  • 0

I am using tabs in JQuery mobile navbar as tabs as given in the reference

http://jquerymobile.com/test/docs/toolbars/docs-navbar.html

However , my requirement is to create vertical tabs like the following but using JQuery mobile

http://jquery-ui.googlecode.com/svn/tags/1.8.2/demos/tabs/vertical.html

My code looks like the following , where I want the tabs to be vertical like above
http://jsfiddle.net/D424Z/1/

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T04:15:43+00:00Added an answer on May 28, 2026 at 4:15 am

    Please find the code below for customized Vertical Nav Bars.

    HTML(index.html)

    <!DOCTYPE html>
    <html>
    <head>
    <link rel="stylesheet" href="jquery.mobile-1.0rc1.css" />
    <link rel="stylesheet" href="main.css" />
    <script type="text/javascript" src="js/Common/jquery-1.6.2.min.js"></script>
    <script type="text/javascript" src="js/Common/jquery.mobile-1.0rc1.js"></script>
    <script type="text/javascript" src="main.js"></script>
    </head>
    <body>
    <div data-role="page" id="header">
            <div data-role="header">
                <h1>Sale Order</h1>
            </div>
            <div data-role="content">
                <!-- top level navigation bar -->
                <div data-role="navbar" id="nav1">
                    <ul class="nav">
    
                        <li><a href="#" data-href="header" class="ui-btn-active">Header</a>
                        </li>
                        <li><a href="#" data-href="line">Lines</a>
                        </li>
                    </ul>
                </div>
                <!-- /navbar -->
                <!-- top level header div which will also contain a navigation bar which will act as subtab menu for the header tab -->
               <div id="lns"> <!--here-->
               <div class="def_content_div" id="header">
    
                    <div data-role="navbar" id="nav2">
                        <ul>
                            <li><a href="#" data-href="main" class="ui-btn-active">h1</a>
                            </li>
                            <li><a href="#" data-href="others">h2</a>
                            </li>
                        </ul>
                    </div>
                    <div style="border-top: 0px" class="ui-btn-active">&nbsp</div>
                    <!-- DIVs associated with the header tab -->
                    <div class="def_sub_content_div" id="main">
                        <p>Main fields</p>
                    </div>
                    <div class="sub_content_div" id="others">
                        <p>Others fields</p>
                    </div>
                </div>
                <!-- Lines tab's DIV which also contains a navigation bar which acts as subtab -->
                <div class="content_div" id="line">
                    <div data-role="navbar" id="nav2">
                        <ul >
                            <li><a href="#" data-href="linemain" class="ui-btn-active">LineMain</a>
                            </li>
                            <li><a href="#" data-href="l1">l1</a>
                            </li>
                            <li><a href="#" data-href="l2">l2</a>
                            </li>
                            <li><a href="#" data-href="l3">l3</a>
                            </li>
    
                        </ul>
                        <div style="border-top: 0px" class="ui-btn-active">&nbsp</div>
                    </div>
                    <!-- DIV elements for the Lines TAB's subtab -->
                    <div class="def_sub_content_div" id="l1">
                        <p>l1</p>
                    </div>
                    <div class="sub_content_div" id="l2">
                        <p>l2</p>
                    </div>
                    <div class="sub_content_div" id="l3">
                        <p>l3</p>
                    </div>
                </div>
            </div>
            </div> <!--here-->
            <div data-role="footer">
                <h4>Footer</h4>
            </div>
    
        </div>
    </body>
    </html>
    

    CSS(main.css)

    /*This class of div will contain the subtab be hidden by default*/
    .content_div {
        display: none;
    }
    /*This is the default subtab of a tab*/
    .def_content_div {
        display: block;
    }
    /*This is the leaf div which will contain the form and the fields*/
    .sub_content_div {
        display: none;
    }
    /*This is the leave div associated with the default subtab*/
    .def_sub_content_div {
        display: block;
    }
    /*Following commented out as does not work*/
    /*
    .sub_content_div:first-child {
        display: block;
    }
    
    .content_div:first-child {
        display: block;
    }
    */
    .ui-btn {
        border-top-left-radius: 10px;
        border-top-right-radius: 10px;
        border-bottom: 0px;
    }
    
    #lns {
        margin-left: 113px;
        margin-top: -91px;
    }
    
    
    ul.nav,
    .nav ul{
    
    margin: 0;
    padding: 0;
    cursor: default;
    list-style-type: none;
    }
    
    ul.nav{
    width: 200px;
    float: left;
    margin-right: 1px;
    }
    
    ul.nav a{
    color: #FFF;
    }
    ul.nav a:hover{
    color: #FF0;
    }
    ul.nav>li{
    margin: 0;
    color: #FFF;
    background-color: #900;
    padding-top: 5px;
    padding-right: 6px;
    padding-bottom: 5px;
    padding-left: 6px;
    font-family: Arial, Helvetica, sans-serif;
    }
    ul.nav li>ul>li{
    margin: 0;
    color: #900;
    background-color: #979700;
    padding-top: 5px;
    padding-right: 6px;
    padding-bottom: 5px;
    padding-left: 6px;
    }
    ul.nav li>ul>li a{
    color: #FFF;
    }
    ul.nav li>ul>li a:hover{
    color: #FF0;
    }
    ul.nav li:hover {
    background-color: #000000;
    color: #FF0;
    background-image: url(../images/hover.jpg);
    }
    
    ul.nav li:hover>ul{
    display : block;
    color: #000;
    }
    ul.nav li>ul{
    display: none;
    position: absolute;
    width: 200px;
    left: 200px;
    margin-top: -5px;
    margin-left: 11px;
    color: #FFFF00;
    background-color: #000000;
    }
    
    ul.nav ul>li>ul{
    display: none;
    position: absolute;
    width: 200px;
    left: 191px;
    margin-top: -5px;
    color: #FFFFFF;
    background-color: #333333;
    margin-left: 9px;
    }
    ul.nav ul>li>ul>li{
    margin: 0;
    color: #FFF;
    background-color: #000;
    padding-top: 5px;
    padding-right: 6px;
    padding-bottom: 5px;
    padding-left: 6px;
    }
    ul.nav ul>li>ul>li a{
    color: #FFF;
    }
    ul.nav ul li ul li a:hover {
    color: #FF0;
    }
    ul{
    border: 1px solid #000;
    }
    .nav a{
    text-decoration: none;
    }
    

    Javascript(main.js)

    //Following event is added to the top level navigation bars/tabs
    $('div[id="nav1"] a').live(
            'click',
            function() {
                $(this).addClass('ui-btn-active');
                $('div.content_div').hide();
                $('div.def_content_div').hide();
                $('div#' + $(this).attr('data-href')).show();
                //The following line will show the div associated with the default subtab of the current tab (which was clicked)
                //e.g "main" is the default subtab for the "headers" tab.
                $('div#' + $(this).attr('data-href')).children(
                        '[class="def_sub_content_div"]').show();
    
            });
    //Following event is addred to the subtabs navigation bar which will show the div associated with it when clicked.
    $('div[id="nav2"] a').live('click', function() {
        $(this).addClass('ui-btn-active');
        $('div.sub_content_div').hide();
        $('div.def_sub_content_div').hide();
        $('div#' + $(this).attr('data-href')).show();
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using jquery tabs ( http://docs.jquery.com/UI/API/1.7.2/Tabs ). Jquery version 1.3.2 and Jquery UI version
Hi I'm using JQuery tabs http://jqueryui.com/demos/tabs/ with search results being returned from my server
I'm using jQuery Tabs UI with standard the tabs structure ( http://jqueryui.com/demos/tabs/ ). I
I have created bottom fixed tabs using jquery mobile data-role=navbar inside a JQ footer.
I'm playing around with jQuery tabs and have a prototype up and running. http://www.omnicom-innovations.com/play/tabsdemo.html
I have created an interface using jQuery UI Tabs, however one of my requirements
I've been using jQuery tabs and I love it. However, if I want to
Using jquery mobile Im using persistant header and footer. The footer nav has tabs
I have some tabs using jQuery UI which work just fine, but I want
I have a page that is using jQuery tabs. Within one of my tabs

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.