Существует два (три?) Типа кнопок JQueryUI;По сути, вы делаете кнопку следующим образом:
<span class="myButtons">Click here</span>
Затем вы сообщаете JQueryUI, что это кнопка:
$('span.myButtons').button()
Таким образом, создается такая разметка:
<span class="myButtons ui-button ui-corner-all ui-widget" role="button">Click here</span>
И вы можете стилизовать этот «классический» способ: (.myButtons {}
, .myButtons:hover {}
и т. Д.)
Но!
Если ваша «кнопка» - одна из checkboxradio или контрольная группа , тогда это другая разметка:
<fieldset>
<legend>Select a Location: </legend>
<label for="radio-1">New York</label>
<input type="radio" name="radio-1" id="radio-1">
<label class"danger" for="radio-2">Paris</label>
<input type="radio" name="radio-1" id="radio-2">
<label for="radio-3">London</label>
<input type="radio" name="radio-1" id="radio-3">
</fieldset>
Тогда если вы примените метод:
$( "input" ).checkboxradio();
Вы получаете эту сгенерированную разметку (2-я псевдокнопка , "Париж" проверен / нажат):
<fieldset>
<legend>Select a Location: </legend>
<label for="radio-1" class="ui-checkboxradio-label ui-corner-all ui-button ui-widget ui-checkboxradio-radio-label"><span class="ui-checkboxradio-icon ui-corner-all ui-icon ui-icon-background ui-icon-blank"></span><span class="ui-checkboxradio-icon-space"> </span>New York</label>
<input name="radio-1" id="radio-1" class="ui-checkboxradio ui-helper-hidden-accessible" type="radio">
<label for="radio-2" class="ui-checkboxradio-label ui-corner-all ui-button ui-widget ui-checkboxradio-radio-label ui-checkboxradio-checked ui-state-active"><span class="ui-checkboxradio-icon ui-corner-all ui-icon ui-icon-background ui-icon-blank"></span><span class="ui-checkboxradio-icon-space"> </span>Paris</label>
<input name="radio-1" id="radio-2" class="ui-checkboxradio ui-helper-hidden-accessible" type="radio">
<label for="radio-3" class="ui-checkboxradio-label ui-corner-all ui-button ui-widget ui-checkboxradio-radio-label"><span class="ui-checkboxradio-icon ui-corner-all ui-icon ui-icon-background ui-icon-blank"></span><span class="ui-checkboxradio-icon-space"> </span>London</label>
<input name="radio-1" id="radio-3" class="ui-checkboxradio ui-helper-hidden-accessible" type="radio">
</fieldset>
А затем эти классы могут (должны?)использовать для стилизации псевдо "кнопок":
.ui-visual-focus {
box-shadow: none;
}
label.ui-checkboxradio.ui-state-default {
color: black;
background-color: teal;
}
label.ui-checkboxradio.danger.ui-state-active {
background-color: red;
}