:::: 개발 ::::/::: JSCRIPT :::

jqeury radio css control

nayha 2013. 11. 11. 17:19


제이 쿼리 라디오버튼 CSS 제어 하기

// 부모 자식 노드를 제어할때는 태그 닫고 열린걸 꼭 확인한다
<부모><자식></자식 닫기></부모닫기>

제어할때
$(this).children().addClass('active');             // 자식노드에 CSS 적용

$(this).parent('span').addClass('active');      // 부모노드에 CSS 적용


//라벨로 제어 할 때


<label for="radio-01" >

<input name="sample-radio" class="screen-out" id="radio-01">

<label for="radio-02" >

<input name="sample-radio" class="screen-out" id="radio-02">


ID를 매칭 시켜 주면 여러가지 컨트롤이 쉽다.


예) 라벨 범위 클릭 라디오 체크(제어) 된다...  


삽질삽질 ㅎㅎ


풀 소스 첨부합니다.


참고 url

http://webdesign.maratz.com/lab/fancy-checkboxes-and-radio-buttons/jquery.html


반응형