g.pickardou
g.pickardou

Reputation: 35973

Collapse jQuery vertical tabs (Collapse div horizontaly)

Here is the jsfiddle prototype: http://jsfiddle.net/TRRP2/

Currently if I press the toggle button, the tabs-only div shows/hide, but the tabs-1 content div stays in place.

The click event code is:

$("#tabs-left").tabs();
$(function () {
    $('#hide').click(function () {
        $('#tabs-only').toggle();
    });
});

I would like the content div align left when the tabs-only div is hidden. With other words the tabs-only div should collapse.

Thx in advance

Upvotes: 0

Views: 1420

Answers (1)

Flo Schild
Flo Schild

Reputation: 5304

As my comment said, you should prefer to do that in CSS.

Your Fiddle updated: http://jsfiddle.net/TRRP2/2/

I just have changed a bit the CSS

#tabs-left {
    position: relative;
    padding-left: 0.5em;
}
#tabs-only {
    float: left;
    width: 130px;
    height: 150px;
}

Upvotes: 1

Related Questions