3

I'm using jquery tabs and a few other jquery widget.

Now, inside the tab, all the content is styled according to the jquery CSS. So, the easiest way is just to comment out or change a few of the jquery CSS definitions. But then obviously all the other widgets like autocomplete are not working anymore either.

How do other people solve this problem? My prefered solution would be, if I could leave the jquery CSS as it is, and just have my own default CSS inside the tabs back.

Example:

.ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; } 

This overrides the text color in my tab. It's ok for the other widgets, but looks bad inside tab.

2 Answers 2

1

I would either use different CSS classes (or start using classes on the elements or a containing element if you aren't already) for your elements, so you aren't conflicting with the jQuery styles.

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

2 Comments

Right. The problem is I have global definitions for things like fonts, colors, etc. And I don't wanna define them for every element again.
As an idea, try wrapping all your content in a div with a specific class, and then defining all your styles to be applied only within that containing div. e.g. div.my_class span { ... }. Then just use that same container inside the tabs. Does that work?
0

I think the solution is to remove the CSS class file with jquery, like in the example for the buttom tabs:

<script>
    $(function() {
        $( "#tabs" ).tabs();
        $( ".tabs-bottom .ui-tabs-nav, .tabs-bottom .ui-tabs-nav > *" )
            .removeClass( "ui-corner-all ui-corner-top" )
            .addClass( "ui-corner-bottom" );
    });
</script>

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.