랜덤관련 스크립트 알려주세요. > 자유게시판

자유게시판

랜덤관련 스크립트 알려주세요. 정보

랜덤관련 스크립트 알려주세요.

본문

페이지 열릴때 , 지정된 테이블 셀에 바탕색이 랜덤으로 보여지는 그런 소스알려주세요.
검색하다가 지쳐서..
추천
0
  • 복사

댓글 6개

이런식으로 말씀인가요?

<style>
#randomcell {background-color:rgb(<?=rand(0,255)?>,<?=rand(0,255)?>,<?=rand(0,255)?>)}
</style>
<table>
<tr>
<td id="randomcell">이 셀은 바탕색이 랜덤이라네</td>
<td>여기는 아니라네</td>
</tr>
</table>
셀이 여러개 있고 아이디를 지정했을때 각셀의 색상이 다르게 랜덤으로 나오는 방법은 있나요?..
스타일로는 힘들겠고 스크립트라도 있으면 알려주세요..
<style>
.cell1 {background-color:#FF0;}
.cell2 {background-color:#F0F;}
.cell3 {background-color:#0FF;}
</style>
<table>
<tr>
<td class="cell<?=rand(1,3)?>">랜덤셀</td>
<td class="cell<?=rand(1,3)?>">랜덤셀</td>
<td class="cell<?=rand(1,3)?>">랜덤셀</td>
<td>이건아님</td>
</tr>
</table>

이런건 어때요?
© SIRSOFT
현재 페이지 제일 처음으로