と私はUI buttons with style - Like | B | I | U | in this example pageを使用していて、HTMLの構造は次のようになり、生成:私は「アリアを変更すると更新 "ARIA-押された" UIボタンのマークアップ/スタイル
<div class="radiocheck ui-buttonset">
<input type="radio" name="radio1" value="1" id="radio0" class="ui-helper-hidden-accessible">
<label for="radio0" aria-pressed="false" class="ui-button ui-widget ui-state-default ui-button-text-only ui-corner-left" role="button" aria-disabled="false">
<span class="ui-button-text">Sobre</span>
</label>
<input type="radio" name="radio1" value="2" id="radio1" class="ui-helper-hidden-accessible">
<label for="radio1" aria-pressed="false" class="ui-button ui-widget ui-state-default ui-button-text-only" role="button" aria-disabled="false">
<span class="ui-button-text">Politica</span>
</label>
<input type="radio" name="radio1" value="3" id="radio2" class="ui-helper-hidden-accessible">
<label for="radio2" aria-pressed="true" class="ui-button ui-widget ui-state-default ui-button-text-only" role="button" aria-disabled="false">
<span class="ui-button-text">Outros</span>
</label>
<input type="radio" name="radio1" value="4" id="radio3" class="ui-helper-hidden-accessible">
<label for="radio3" aria-pressed="false" class="ui-button ui-widget ui-state-default ui-button-text-only ui-corner-right" role="button" aria-disabled="false">
<span class="ui-button-text">Promocoes</span>
</label>
『「から propertie』真-pressed、ボタンは全く変化していない...私はこのようにしようと試みたが、それはうまくいきませんでした:
var myhappyidtest = 2;
$('.radiocheck input').each(function(i){ if(myhappyidtest == $(this).val()){ $(this).next('label').attr('aria-pressed', 'true'); } });
私はトンを見ましたボタンケースの帽子は、をリフレッシュすることができます。 しかし、私はラベルでこの場合にこれを行う方法について考えていません。
誰かがアイデアを持っていますか?
私はARIAの属性が無効なユーザーに情報を伝えるのに役立つ支援技術のために特別にと思っていました。私はそれがボタンの外観に何らかの影響を与えるとは思わない。 – clamchoda
クリスおかげさま!私は解決策を見つけた...とても簡単! =)** ai-pressed **を** true **に設定する前に、** ui-state-active **クラスを要素に追加するだけです。 –
問題ありません、ハッピーコーディング;) – clamchoda