Button jQuery UI: how to override classes used for one button?

I am using jQuery UI from a theme-based library.

Having links made as buttons is fine, however I need to redefine some buttons with different colors.

How to specify a specific class for a specific button?

+5
source share
6 answers

I would say give a specific button or buttons an identifier and:

$("#buttonId").removeClass().addClass("myClass");

If you want to apply it to multiple buttons, each with its own id:

$("#buttonId, #anotherButton").removeClass().addClass("myClass");
+1
source

CSS jQuery CSS, , , jQuery UI. , CSS, CSS- jQuery. CSS , , . , , CSS, jQuery, CSS .

Smashing Magazine , , , , .

+5

:

  • ( Chrome ).
  • , jQuery UI .
  • CSS "! important".

, jQuery UI spinner , , Chrome Dev. CSS: - :

.<jquery-ui-class-that-i-found> { border: 0px !important; }

!

+3

, API ​​, ..,

$("button").button({background:"FFFFFF",hover:"FFFFF"}); 

, .

+2

, : $ ( "BtnSave." ) RemoveClass ( "- " ) addClass ( "SaveButtonStyling" );..

ui-state-default, ..

Thsi , .. , ..

+1

/ , , class= "mybuttonclass otherbuttonclass" - . css ()

.mybuttonclass
{
   background-color: red;
}
.otherbuttonclass
{
   color:white;
}

, - , , (CSS) . (, .CSS jQuery jQuery jQuery , jQuery UI css.

0

All Articles