'자바스크립트 열리고 닫힘'에 해당되는 글 1건

  1. 2011.11.04 [Javascript] - 클릭시 열리고 닫히는 소스 예제(무조건 한개씩 열림) (펼침) 2

[Javascript] - 클릭시 열리고 닫히는 소스 예제(무조건 한개씩 열림) (펼침)

카테고리 없음 2011. 11. 4. 10:01
반응형
#######################################################################
# Title   : 1. 열고 닫히는 자바스크립트(무조건 한개씩 열림                          #
#######################################################################

<script>
var old_id = "answer_01";

function display_yn(id_num)
{
var id = "answer_" + id_num;

if(old_id == "")
{

document.getElementById(id).style.display = "";
old_id = id;

}else if(old_id != id)
{

document.getElementById(id).style.display = "";
document.getElementById(old_id).style.display = "none";

old_id = id;

}

}
</script>

<tr id="answer_01">
  <td width="90%" align="left" style="background:url('../images/icon_bg.gif') no-repeat 30px 18px;padding:10px 0 10px 40px;border-bottom:1px dotted #dedede;line-height:26px;">
2010년도 WPM 신규지원사업 - 참여기업<br />
2010. 08. 01 ~  2018. 02 28.   (103 개월)
</td>
<td width="10%" align="center" style="border-bottom:1px dotted #dedede;">
<?=fnc_file_exists($virtual.$path_innovation, "IR100.pdf")?>
</td>
</tr>

<tr style="cursor:pointer;" onclick="display_yn('02'); return false;">
<td colspan="2" align="left" style="height:30px;background:url('../images/icon_bg.gif') no-repeat 10px 10px;background-color:#f6f5f4;padding-left:20px;border-bottom:1px dotted #dedede;">차세대 복합기능성 자동차용 내장재 개발</td>
</tr>
<tr id="answer_02" style="display:none;">
<td width="90%" align="left" style="background:url('../images/icon_bg.gif') no-repeat 30px 18px;padding:10px 0 10px 40px;border-bottom:1px dotted #dedede;line-height:26px;">
답변입니다.....................
</td>
<td width="10%" align="center" style="border-bottom:1px dotted #dedede;">
<?=fnc_file_exists($virtual.$path_innovation, "IR100.pdf")?>
</td>
</tr>

<tr style="cursor:pointer;" onclick="display_yn('03'); return false;">
<td colspan="2" align="left" style="height:30px;background:url('../images/icon_bg.gif') no-repeat 10px 10px;background-color:#f6f5f4;padding-left:20px;border-bottom:1px dotted #dedede;">LCD 광확산 시트용 초미립자의 혼합기술의 개발</td>
</tr>
<tr id="answer_03" style="display:none;">
<td width="90%" align="left" style="background:url('../images/icon_bg.gif') no-repeat 30px 18px;padding:10px 0 10px 40px;border-bottom:1px dotted #dedede;line-height:26px;">
답변입니다.....................
</td>
<td width="10%" align="center" style="border-bottom:1px dotted #dedede;">
<?=fnc_file_exists($virtual.$path_innovation, "IR100.pdf")?>
</td>
</tr>

<tr style="cursor:pointer;" onclick="display_yn('04'); return false;">
<td colspan="2" align="left" style="height:30px;background:url('../images/icon_bg.gif') no-repeat 10px 10px;background-color:#f6f5f4;padding-left:20px;border-bottom:1px dotted #dedede;">초고전도 나노복합소재(고분자/금속)</td>
</tr>
<tr id="answer_04" style="display:none;">
<td width="90%" align="left" style="background:url('../images/icon_bg.gif') no-repeat 30px 18px;padding:10px 0 10px 40px;border-bottom:1px dotted #dedede;line-height:26px;">
답변입니다.....................
</td>
<td width="10%" align="center" style="border-bottom:1px dotted #dedede;">
<?=fnc_file_exists($virtual.$path_innovation, "IR100.pdf")?>
</td>
</tr>

<tr style="cursor:pointer;" onclick="display_yn('05'); return false;">
<td colspan="2" align="left" style="height:30px;background:url('../images/icon_bg.gif') no-repeat 10px 10px;background-color:#f6f5f4;padding-left:20px;border-bottom:1px dotted #dedede;">나노클레이를 이용한 단열바용 소재개발</td>
</tr>
<tr id="answer_05" style="display:none;">
<td width="90%" align="left" style="background:url('../images/icon_bg.gif') no-repeat 30px 18px;padding:10px 0 10px 40px;border-bottom:1px dotted #dedede;line-height:26px;">
답변입니다.....................
</td>
<td width="10%" align="center" style="border-bottom:1px dotted #dedede;">
<?=fnc_file_exists($virtual.$path_innovation, "IR100.pdf")?>
</td>
</tr>
반응형
: