[etc] 라디오 버튼의 이미지화 토클
본문
<input type="radio" name="wr_3" style="display:none" value="1">
<input type="radio" name="wr_3" style="display:none" value="2">
<input type="radio" name="wr_3" style="display:none" value="3">
<script>
function setImageRadio(){
document.getElementById('img0').src=
(document.getElementsByName('wr_3')[0].checked==true)?"<?=$board_skin_path?>/img/chan_on.gif":"<?=$board_skin_path?>/img/chan.gif";
document.getElementById('img1').src=
(document.getElementsByName('wr_3')[1].checked==true)?"<?=$board_skin_path?>/img/ban_on.gif":"<?=$board_skin_path?>/img/ban.gif";
document.getElementById('img2').src=
(document.getElementsByName('wr_3')[2].checked==true)?"<?=$board_skin_path?>/img/jung_on.gif":"<?=$board_skin_path?>/img/jung.gif";
}
</script>
<IMG SRC="<?=$board_skin_path?>/img/<?if ($write[wr_3]==1){ echo 'chan_on.gif';}else echo'chan.gif';?>" ALT="" id="img0"
onClick="document.getElementsByName('wr_3')[0].checked=true; setImageRadio();">
<IMG SRC="<?=$board_skin_path?>/img/<?if ($write[wr_3]==2){ echo 'ban_on.gif';}else echo'ban.gif';?>" ALT="" id="img1"
onClick="document.getElementsByName('wr_3')[1].checked=true; setImageRadio();">
<IMG SRC="<?=$board_skin_path?>/img/<?if ($write[wr_3]==3){ echo 'jung_on.gif';}else echo'jung.gif';?>" ALT="" id="img2"
onClick="document.getElementsByName('wr_3')[2].checked=true; setImageRadio();">
<input type="radio" name="wr_3" style="display:none" value="2">
<input type="radio" name="wr_3" style="display:none" value="3">
<script>
function setImageRadio(){
document.getElementById('img0').src=
(document.getElementsByName('wr_3')[0].checked==true)?"<?=$board_skin_path?>/img/chan_on.gif":"<?=$board_skin_path?>/img/chan.gif";
document.getElementById('img1').src=
(document.getElementsByName('wr_3')[1].checked==true)?"<?=$board_skin_path?>/img/ban_on.gif":"<?=$board_skin_path?>/img/ban.gif";
document.getElementById('img2').src=
(document.getElementsByName('wr_3')[2].checked==true)?"<?=$board_skin_path?>/img/jung_on.gif":"<?=$board_skin_path?>/img/jung.gif";
}
</script>
<IMG SRC="<?=$board_skin_path?>/img/<?if ($write[wr_3]==1){ echo 'chan_on.gif';}else echo'chan.gif';?>" ALT="" id="img0"
onClick="document.getElementsByName('wr_3')[0].checked=true; setImageRadio();">
<IMG SRC="<?=$board_skin_path?>/img/<?if ($write[wr_3]==2){ echo 'ban_on.gif';}else echo'ban.gif';?>" ALT="" id="img1"
onClick="document.getElementsByName('wr_3')[1].checked=true; setImageRadio();">
<IMG SRC="<?=$board_skin_path?>/img/<?if ($write[wr_3]==3){ echo 'jung_on.gif';}else echo'jung.gif';?>" ALT="" id="img2"
onClick="document.getElementsByName('wr_3')[2].checked=true; setImageRadio();">
추천0
ChanbiZ님의 댓글
ChanbiZ쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 작성일하하 괜찮으네요.
음... 조금 수정해서 담에 써야지 ㅎㅎ