Skip to main content

Search and Top Navigation

#7462 closed feature (notabug)

Opened June 10, 2011 04:25PM UTC

Closed June 25, 2011 08:08AM UTC

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

#!xml
<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.

#!js
	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");
	});
Attachments (0)
Change History (2)

Changed June 10, 2011 05:53PM UTC by scottgonzalez comment:1

owner: → javamaniac
status: newpending

What is the actual use case?

Changed June 25, 2011 08:08AM UTC by trac-o-bot comment:2

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!