Opened 8 years ago

Closed 8 years ago

#7462 closed feature (notabug)

Able to put the content div anywhere

Reported by: javamaniac Owned by: javamaniac
Priority: minor Milestone: 1.9.0
Component: ui.tabs Version: 1.8.13
Keywords: Cc:
Blocked by: Blocking:

Description

I often need to put the divs "content" elsewhere and not be forced to put them directly under the div "tabs".

Example

<div id="tabs">
   <ul>
      <li>
         <a href="#tabs-1">Tab 1</a>
      </li>
      <li>
         <a href="#tabs-2">Tab 2</a>
      </li>
   </ul>
   <table>
      <tr>
         <td>something</td>
         <td>
            <div id="tabs-1">content 1</div>
            <div id="tabs-2">content 2</div>
         </td>
      </tr>
   </table>
</div>

I wrote a minimal solution until the jQuery UI Tabs allows this.

        var tabs = $("#tabs li");
        var panels = $("#tabs-1,#tabs-2,#tabs-3");

        $("#tabs li").bind('click', function() {
                var currentTab = $(this);

                if (!currentTab.hasClass("ui-tabs-selected"))
                {               
                        var panelName = $(this).children("a").attr("href");
                        var panel = $('#' + panelName);
                        
                        if (panel.hasClass("ui-tabs-hide"))
                        {
                                panels.addClass("ui-tabs-hide");
                                panel.removeClass("ui-tabs-hide");
                        }
                        
                        tabs.removeClass("ui-tabs-selected ui-state-active");           
                        currentTab.addClass("ui-tabs-selected ui-state-active");
                }
        });
        
        $("#tabs li").bind('mouseover', function() {
                $(this).addClass("ui-state-hover");
        });
        $("#tabs li").bind('mouseout', function() {
                $(this).removeClass("ui-state-hover");
        });

Change History (2)

comment:1 Changed 8 years ago by Scott González

Owner: set to javamaniac
Status: newpending

What is the actual use case?

comment:2 Changed 8 years ago by trac-o-bot

Resolution: invalid
Status: pendingclosed

Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!

Note: See TracTickets for help on using tickets.