0

I'm using jquery tabs in my web application. The tabs are created dynamically depending on the user query result. I have a couple issues:

  1. My tab is pointing to <div> content with the corresponding id. When the user clicks the tab, the content is filled with a result of a webservice request (not relevant to the issue). My first problem is that when I add the items inside the tab (<div> tags), I see that it's not being placed inside the panel of the tab. I'm using selectedTab.append("<div class=itemSummary>" + getItemDetails(element) + "</div>") to add a new <div> section to the tab. However, I do see new items being added outside the border of the tab panel. Am I doing something wrong here?

  2. Simple question: how can I programmatically clear the tab content? I need the tab content to be cleared before I add new items to it.

Thanks!

2
  • my current selected tab, i.e : $('#tabs') Commented Aug 5, 2011 at 5:15
  • You need to provide more code! When content is not displaying inside the borders of the Tabs, it's either CSS issue where content is overflowing in absolute position or content is being placed right outside of the Tab content container but before next Tab contents. Best way to clear content and load new inside the tab panel would be to use something like selectedTab.html(VarWithHTMLcontent); and make sure to store new content into the content variable before you call this line. This line will replace all inside content with whatever is stored in the variable. Commented Aug 5, 2011 at 5:43

1 Answer 1

1

simple, use the $.empty(); function on the container that own the content .

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.