및 HTML 구조는 다음과 같이 생성 : 나는 "아리아를 변경새로 고침 마크 업 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>
-pressed " propertie 에"true "로, 버튼 내가이 방법을 tryed ... 전혀 변경되지 않습니다,하지만 작동하지 않았다 :
var myhappyidtest = 2;
$('.radiocheck input').each(function(i){ if(myhappyidtest == $(this).val()){ $(this).next('label').attr('aria-pressed', 'true'); } });
나는 t을 보았다 단추 케이스의 모자는 으로 새로 고침이 가능합니다. 그러나이 경우 레이블을 사용하여이를 수행하는 방법에 대해서는 알지 못합니다.
누군가가 아이디어를 가지고 있습니까?
내가 지원 전환 기술을 사용하지 않는 사용자에게 정보를 전달하기 위해의 아리아 속성이 특별히 있다고 생각했다. 단추의 모양에 영향을 미치지 않는다고 생각합니다. – clamchoda
크리스! 나는 해결책을 찾았다. .. 매우 단순한! =) ** ai-pressed **를 ** true **로 설정하기 전에 요소에 ** UI 상태 ** 클래스를 추가하기 만하면됩니다! –
문제 없습니다, 행복한 코딩;) – clamchoda