• Nunc tincidunt
  • Proi" />
    • Nunc tincidunt
    • Proi" />
      • Nunc tincidunt
      • Proi"/>
        DEVHIDE
        • Home (current)
        • About
        • Contact
        • Cookie
        • Home (current)
        • About
        • Contact
        • Cookie
        • Disclaimer
        • Privacy
        • TOS
        Login Or Sign up

        How to connect several jquery tabs?

        134 Views Asked by user2285576 At 23 August 2013 at 17:07 2025-12-19T01:11:26.063125

        See the example here - http://jsfiddle.net/d1st/KyWqR/5/

        <div id="tabs">
          <ul>
            <li><a href="#tabs-1">Nunc tincidunt</a></li>
            <li><a href="#tabs-2">Proin dolor</a></li>
            <li><a href="#tabs-3">Aenean lacinia</a></li>
          </ul>
          <div id="tabs-1">
            <p><strong>Click this tab again to close the content pane.</strong></p>
            <p>Proin elit arcu, rutrum commodo, vehicula tempus, commodo a, risus. Curabitur nec arcu. Donec sollicitudin mi sit amet mauris. Nam elementum quam ullamcorper ante. Etiam aliquet massa et lorem. Mauris dapibus lacus auctor risus. Aenean tempor ullamcorper leo. Vivamus sed magna quis ligula eleifend adipiscing. Duis orci. Aliquam sodales tortor vitae ipsum. Aliquam nulla. Duis aliquam molestie erat. Ut et mauris vel pede varius sollicitudin. Sed ut dolor nec orci tincidunt interdum. Phasellus ipsum. Nunc tristique tempus lectus.</p>
          </div>
          <div id="tabs-2">
            <p><strong>Click this tab again to close the content pane.</strong></p>
            <p>Morbi tincidunt, dui sit amet facilisis feugiat, odio metus gravida ante, ut pharetra massa metus id nunc. Duis scelerisque molestie turpis. Sed fringilla, massa eget luctus malesuada, metus eros molestie lectus, ut tempus eros massa ut dolor. Aenean aliquet fringilla sem. Suspendisse sed ligula in ligula suscipit aliquam. Praesent in eros vestibulum mi adipiscing adipiscing. Morbi facilisis. Curabitur ornare consequat nunc. Aenean vel metus. Ut posuere viverra nulla. Aliquam erat volutpat. Pellentesque convallis. Maecenas feugiat, tellus pellentesque pretium posuere, felis lorem euismod felis, eu ornare leo nisi vel felis. Mauris consectetur tortor et purus.</p>
          </div>
          <div id="tabs-3">
            <p><strong>Click this tab again to close the content pane.</strong></p>
            <p>Duis cursus. Maecenas ligula eros, blandit nec, pharetra at, semper at, magna. Nullam ac lacus. Nulla facilisi. Praesent viverra justo vitae neque. Praesent blandit adipiscing velit. Suspendisse potenti. Donec mattis, pede vel pharetra blandit, magna ligula faucibus eros, id euismod lacus dolor eget odio. Nam scelerisque. Donec non libero sed nulla mattis commodo. Ut sagittis. Donec nisi lectus, feugiat porttitor, tempor ac, tempor vitae, pede. Aenean vehicula velit eu tellus interdum rutrum. Maecenas commodo. Pellentesque nec elit. Fusce in lacus. Vivamus a libero vitae lectus hendrerit hendrerit.</p>
          </div>
        </div>
        <div id="tabs2">
          <ul>
            <li><a href="#tabs-1">Nunc tincidunt</a></li>
            <li><a href="#tabs-2">Proin dolor</a></li>
            <li><a href="#tabs-3">Aenean lacinia</a></li>
          </ul>
          <div id="tabs-1">
            <p><strong>Click this tab again to close the content pane.</strong></p>
            <p>Proin elit arcu, rutrum commodo, vehicula tempus, commodo a, risus. Curabitur nec arcu. Donec sollicitudin mi sit amet mauris. Nam elementum quam ullamcorper ante. Etiam aliquet massa et lorem. Mauris dapibus lacus auctor risus. Aenean tempor ullamcorper leo. Vivamus sed magna quis ligula eleifend adipiscing. Duis orci. Aliquam sodales tortor vitae ipsum. Aliquam nulla. Duis aliquam molestie erat. Ut et mauris vel pede varius sollicitudin. Sed ut dolor nec orci tincidunt interdum. Phasellus ipsum. Nunc tristique tempus lectus.</p>
          </div>
          <div id="tabs-2">
            <p><strong>Click this tab again to close the content pane.</strong></p>
            <p>Morbi tincidunt, dui sit amet facilisis feugiat, odio metus gravida ante, ut pharetra massa metus id nunc. Duis scelerisque molestie turpis. Sed fringilla, massa eget luctus malesuada, metus eros molestie lectus, ut tempus eros massa ut dolor. Aenean aliquet fringilla sem. Suspendisse sed ligula in ligula suscipit aliquam. Praesent in eros vestibulum mi adipiscing adipiscing. Morbi facilisis. Curabitur ornare consequat nunc. Aenean vel metus. Ut posuere viverra nulla. Aliquam erat volutpat. Pellentesque convallis. Maecenas feugiat, tellus pellentesque pretium posuere, felis lorem euismod felis, eu ornare leo nisi vel felis. Mauris consectetur tortor et purus.</p>
          </div>
          <div id="tabs-3">
            <p><strong>Click this tab again to close the content pane.</strong></p>
            <p>Duis cursus. Maecenas ligula eros, blandit nec, pharetra at, semper at, magna. Nullam ac lacus. Nulla facilisi. Praesent viverra justo vitae neque. Praesent blandit adipiscing velit. Suspendisse potenti. Donec mattis, pede vel pharetra blandit, magna ligula faucibus eros, id euismod lacus dolor eget odio. Nam scelerisque. Donec non libero sed nulla mattis commodo. Ut sagittis. Donec nisi lectus, feugiat porttitor, tempor ac, tempor vitae, pede. Aenean vehicula velit eu tellus interdum rutrum. Maecenas commodo. Pellentesque nec elit. Fusce in lacus. Vivamus a libero vitae lectus hendrerit hendrerit.</p>
          </div>
        </div>
        
        
        
        $(function () {
            $("#tabs, #tabs2").tabs({
                collapsible: true,
                hide: 'blind', 
                show: 'blind',
                active: false,
                autoHeight: false
            });
        });
        

        This is two separated tab-containers (two different rows). This is what I need, but I want to make so:

        if I open tab in second row, then tab in first row should close. As if i open/close tabs in same row (in same container).

        How can i do it?

        Thaks for your answers.

        jquery jquery-ui tabs jquery-ui-tabs jquery-tabs
        Original Q&A
        2

        There are 2 best solutions below

        0
        user2285576 user2285576 On 02 September 2013 at 14:48 BEST ANSWER

        I have my own decision!

            var a;
        $("#tab-main-block > div").tabs({
            collapsible: true,
            hide: 'blind',
            show: 'blind',
            active: false,
            autoHeight: false
        });
        $("#tab-main-block > div ul li").click(function () {
            $("#tab-main-block > div ul li").not(this).attr('aria-selected','false');
            $("#tab-main-block > div ul li").not(this).attr('class','ui-state-default ui-corner-top');
            a = $(this).parents().eq(1);
            $("#tab-main-block > div").not(a).children().not("ul").slideUp(); 
        });
        
        1
        SarathSprakash SarathSprakash On 23 August 2013 at 17:54

        DEMO

        Try this

        $(function () {
            var a;
            var b;
            $("#tabs, #tabs2").tabs({
                collapsible: true,
                hide: 'blind',
                show: 'blind',
                active: false,
                autoHeight: false
            });
            $("#tabs ul li").click(function () {
               a=$(this);
                b.attr('aria-selected','false');
                b.attr('class','ui-state-default ui-corner-top');
               $("#tabs2").children().not("ul").slideUp();
            });
             $("#tabs2 ul li").click(function () {
                 b=$(this);
                 a.attr('aria-selected','false');
                 a.attr('class','ui-state-default ui-corner-top');
             $("#tabs").children().not("ul").slideUp();
            });
            });
        

        Hope this helps,Thank you

        Related Questions in JQUERY

        • In Datatables, start value resets to 0, when column sorting
        • Bootstrap modal not showing at the desired position on a web page when the screen size is smaller
        • window.location.href redirects but is causing problems on the webpage
        • Using JQuery Date Slider
        • Storing selected language in localStorage
        • How to stop other divs from still showing when i click a different button?
        • Check multiple values with jQuery
        • Bootstrap component does not want to render in Datatables function
        • put white spaces when entering an amount moneytype symfony
        • Trouble accessing custom header in AJAX response using jQuery in Fiware Keyrock
        • I just cant make it work, HTML, JS and Firebase error
        • Didn't declared variable still not getting any error in JavaScript
        • Move element horizontally while scrolling vertically in pure JavaScript
        • allow multi carousel in same page
        • Embedded TikTok posts / thumbnail styling issue

        Related Questions in JQUERY-UI

        • jquery__WEBPACK_IMPORTED_MODULE_13__(...).sortable is not a function
        • Jquery autopopulate not displaying
        • jQuery plugin is not shown
        • How to upgrade blueimp jquery file upload to use jquery-widget 1.13
        • Set value JQUERY UI Slider with LeaFlet map
        • trying to delete existing tabs which were dynamically added
        • Jquery UI sortable addon with React not working
        • Angular.js directive does not work for uib-tooltip
        • tooltip for input fields not loading
        • How to install jq.Schedule in Vue3 + Typescript
        • JQuery - Drag, Drop and Sortable
        • tabs getting adding again and again
        • JQuery UI remove tooltip on successful input
        • jQuery Autocomplete Firing to Wrong URL
        • How to add total count in centre of the doughnut chart and bottom left and right value using Chart.js?

        Related Questions in TABS

        • Visual Studio 2022 convert spaces to tabs on checkout and back to spaces on checkin
        • How to get new text input after entering a password in a tab?
        • I need assistance with scripting between tabs for Google Sheets
        • Removing tabPanel(s) with same title in shiny
        • I want change the color of TabRow to black using indicatorColor = Color.Black, but in material3 indicatorColor not exist anymore
        • Change background on Tab react native app
        • User non Administer System on Apache Guacamole can access history tab?
        • Chrome Extension: Uncaught SyntaxError: Unexpected reserved word
        • Switching between tabs Ant Design Vue
        • Automatically log the user out when the browser or tab closes
        • create new workbook from excel tab and save to new location and close it and then grab the next tab and save to a different location using VBA
        • Make the Reviews Tab Active on Elementor Product Data Tabs
        • Blazor Web App: How to correctly open razor pages from referenced projects in new tabs?
        • Visual Studio 2022 Community: Tab Spacing Off (Extra Indent?)
        • How to create a pivot table that pulls data from multiple tabs?

        Related Questions in JQUERY-UI-TABS

        • Dynamically created jQuery Tabs on ColdFusion Pages
        • jquery tabs sometimes set the iframe height to zero
        • How to activate the parent tab content using javascript?
        • jQuery UI tabs using aria-controls instead of title to have a single panel
        • Remember last clicked tab on page refresh
        • Uncaught Error: Method load does not exist on jQuery.tabs
        • How to integrate JqueryUI Tabs in Blazor webAssembly application
        • Load Php Page Inside Jquery Chrome Tabs
        • Jquery tab navigation not working properly
        • jquery-ui tab "Interactive controls must not be nested"
        • Jquery tab not showing first child selected
        • Reactjs Dynamically call components having cards under tabpanels using array
        • How to manipulate Bootstrap tabs from another page using Ajax
        • link to a page with tabbed content doesnt work
        • I want a single page scroll with top nav menu scroll and active (Active menu should be in first position scroll)

        Related Questions in JQUERY-TABS

        • Timed jQuery rotation
        • jQuery tabs ui not working
        • How to remember last selected tab using jQuery?
        • Including google visualization timeline in JQuery UI Dialog fails
        • Issue with google.maps.event.trigger(map, “resize”) in jquery tabs
        • Google recaptcha with jquery tabs and validate won't send site_key only
        • jQuery Mobile tabs disable(): Uncaught Error: jQuery UI Tabs: Mismatching fragment identifier
        • angularjs with bootstrap vertical nested tab load the content using ajax
        • Template rendered callback
        • Avoid multiple parent traversing iterations in jQuery
        • How to use .net aspx page inside one .aspx page without using IFRAME tag. I have used jquery tab but its not working
        • using jquery validationengine in jquery ui tabs - more form
        • Two mixitup on one page under tabs
        • How to show active tab on page load jQuery Scrolltabs?
        • Changing tabs and landing back on the same tab?

        Trending Questions

        • UIImageView Frame Doesn't Reflect Constraints
        • Is it possible to use adb commands to click on a view by finding its ID?
        • How to create a new web character symbol recognizable by html/javascript?
        • Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
        • Heap Gives Page Fault
        • Connect ffmpeg to Visual Studio 2008
        • Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
        • How to avoid default initialization of objects in std::vector?
        • second argument of the command line arguments in a format other than char** argv or char* argv[]
        • How to improve efficiency of algorithm which generates next lexicographic permutation?
        • Navigating to the another actvity app getting crash in android
        • How to read the particular message format in android and store in sqlite database?
        • Resetting inventory status after order is cancelled
        • Efficiently compute powers of X in SSE/AVX
        • Insert into an external database using ajax and php : POST 500 (Internal Server Error)

        Popular # Hahtags

        javascript python java c# php android html jquery c++ css ios sql mysql r reactjs node.js arrays c asp.net json

        Popular Questions

        • How do I undo the most recent local commits in Git?
        • How can I remove a specific item from an array in JavaScript?
        • How do I delete a Git branch locally and remotely?
        • Find all files containing a specific text (string) on Linux?
        • How do I revert a Git repository to a previous commit?
        • How do I create an HTML button that acts like a link?
        • How do I check out a remote Git branch?
        • How do I force "git pull" to overwrite local files?
        • How do I list all files of a directory?
        • How to check whether a string contains a substring in JavaScript?
        • How do I redirect to another webpage?
        • How can I iterate over rows in a Pandas DataFrame?
        • How do I convert a String to an int in Java?
        • Does Python have a string 'contains' substring method?
        • How do I check if a string contains a specific word?

        Copyright © 2021 Jogjafile Inc.

        • Disclaimer
        • Privacy
        • TOS
        • Homegardensmart
        • Pricesm.com
        • Aftereffectstemplates
        • Jogjafile