5

At http://docs.jquery.com/UI/Tabs#Example there is a short HTML example of how to use JQuery UI Tabs.

  • I put the HTML in a local index.htm file.
  • I downloaded all the CSS and Javascript files, and saved them in local files:
  • but the closest I can get is the same example without any color in the tabs.
  • I've looked around for images, etc. but can't find any.
  • I can even have everything local EXCEPT the CSS file which I get off their server and THEN it works, so it is something in the CSS file that I'm not getting.

What am I not copying locally that the online CSS file has? Has anyone gotten this JQuery UI Tabs to work and have a zip file that works locally?

3 Answers 3

12

If your problem is that everything seems to run but the DIVs do not disappear as they should then you have probably run into the same problem I did.

You need to define the class .ui-tabs-hide so that it hides the element. Basically jQuery uses this to hide the elements, rather than doing it manually with display: none. The reason for this is so that it doesn't mess with your display's default setting, which could be block, inline or anything. By adding and removing the class it gives you a more control.

.ui-tabs-hide
{
  display: none
}
Sign up to request clarification or add additional context in comments.

Comments

6

For the UI tabs to work you NEED some CSS. The documentation states the minimum required.

The problem you have with the example theme is because the css file used references other CSS files. You need to copy them all locally. You also need an image under the themes/flora/i folder.

1 Comment

yes, that was it, I downloaded this image and now all works well, thanks: ui.jquery.com/latest/themes/flora/i/tabs.png
3

I had the same problem which is why I am here and it took a while to find the problem. Thanks to kgiannakakis answer with the CSS I found on the JqueryUI page this CSS in the source code:

<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.8/themes/base/jquery-ui.css" type="text/css" media="all" />

Add it BEFORE your main CSS like this for example:


And then you should be fine - it works for me.

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.