Override CSS from ui-disable class

Asked

Viewed 135 times

1

I have a navbar as footer.

The first element of navbar has the class ui-disabled not be possible to interact with it.

Here is the FIDDLE

HTML/Jquery

<div data-role="footer" data-position="fixed" data-theme="c" data-tap-toogle="false">
            <div data-role="navbar" data-grid="b">
                    <ul>
                       <li class="ui-disabled"><a id="listSO_options">Opções</a></li>
                       <li><a class = "ui-btn-active  nav" href="#">menu</a></li>
                       <li><a class = "nav" href="#" id="listSO_btnDef" data-icon="gear">Definições</a></li>
                    </ul>
            </div>
</div><!-- footer -->

Question

As noted in the fiddle, the first element is more faded than the next two. It is possible, using CSS and keeping the first element with the class ui-disabled make it identical to the rest li's ?

In case I have been less explicit: it is possible to annul the CSS class characteristic ui-disabled?

  • 1

    One solution would be for you to copy the CSS from the ui-disable class, put it in your css file under another name, and associate this new class with your li. So you could change his css without losing the original property. Have you tried this? It would look something like <li class="ui-disabledNovaClasse"><a id="listSO_options">Options</a></li>

1 answer

4


The difference is that the disabled has opacity: .3;, Restoring opacity to 1 solves the problem.

Using

$('[data-role="navbar"] li:first').css('opacity', 1);

solves the problem.

jsFiddle: http://jsfiddle.net/u2d9ttym/6/

If you decide to apply cia CSS class you have to use !important; to override the rule. Using Javascript as I mentioned above is not necessary because applying the element has priority.

  • I created in CSS and it worked like you said. Thank you. I was trying to add now on CSS also the pointer-events: auto !important; to test, but the CSS he won’t. you can explain to me why? FIDDLE

  • @msm.oliveira what you want to happen with pointer-events: auto !important;? what kind of behavior you want?

  • I just solved it XD. thanks

  • @msm.oliveira ok, good! I was out and only now I got to the PC. Good that it is already solved.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.