jQuery UI & Tabs: Collapsible content

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

jQuery UI Tabs – Collapse content

Click the selected tab to toggle its content closed/open.

To enable this functionality, set the collapsible option to true.

<!doctype html>
<html lang='en'>
    <meta charset='utf-8'>
    <title>jQuery UI Tabs - Collapse content</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 () {
                collapsible: true

<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'>
        <p><strong>Click this tab again to close the content pane.</strong></p>

        <p>Pitbull is a Cuban–American recording artist and Latin Grammy winning rapper from Miami, Florida.</p>
    <div id='tabs-2'>
        <p><strong>Click this tab again to close the content pane.</strong></p>

        <p>Sean Kingston pursued a music career and debuted in 2007 with the album Sean Kingston.</p>
    <div id='tabs-3'>
        <p><strong>Click this tab again to close the content pane.</strong></p>

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

Try The Code Tab Widgets Api Doc
Series Navigation<< jQuery UI & Tabs: Vertical tabs
jQuery UI & Tabs: Tabs at bottom >>

Leave a comment

Leave a Reply