tags:

views:

28

answers:

1

I want to implement a "show more" paginator inside of a jQuery tab panel. If the user clicks the "show more" link, I want to load more elements and append them to the existing contents of the tab panel.

I'm hoping there is some way to access the "ui" element that is available in the standard event callbacks. Something like this...

var tabPanel = $('#myTabsElement').tabs().ui.panel; 
moreElements.appendTo(tabPanel);

Is there an easy way to access this object?

A: 

To access the <div> containing a tab's contents, use the standard jQuery selector function. See http://jqueryui.com/demos/tabs/ for an example of tabs in action. Using that example, you might use the following code to append to the "panel" of the third tab:

var tabPanel = $('tabs-3');
moreElements.appendTo(tabPanel);
ChessWhiz
Actually, I want to add additional content to the panel of an existing tab. Thanks, though.
EndlessLoop
Edited my answer to cover that instead.
ChessWhiz
Ah, so the id of the ui.panel div matches the title attribute of the label's anchor. I overlooked that. Thanks so much for the help.
EndlessLoop
Yes, that tabs demo page has a lot of good info. If I answered your question, go ahead and click the green checkmark next to my answer to mark it as correct. Thanks, and welcome to Stack Overflow!
ChessWhiz