메뉴 클릭시 색상 넣기가 잘 안되네요 ㅠㅠ > 그누4 질문답변

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기
기존 게시물은 열람만 가능합니다.

메뉴 클릭시 색상 넣기가 잘 안되네요 ㅠㅠ 정보

메뉴 클릭시 색상 넣기가 잘 안되네요 ㅠㅠ

첨부파일

menu.php (4.6K) 15회 다운로드 2012-11-24 16:45:00

본문

안녕하세요 ^^

정말 좋은 예로 ... 바로 옆에  SIR 우측메뉴바를 보시면,

질문답변 클릭하시면 게시판 이동되면서 질문답변에 글씨색상이 분홍색으로 바뀌잖아요~

이것을 표현하고 싶은데요.. 모든 검색을 다 해서 해봤는데도 안되서 질문까지 올립니다. ㅠㅠ

우선 제가 쓰는 좌측 메뉴바 소스는 첨부로 걸었습니다~

파일 9 번째 줄에
<style>

a.subject:link, a.subject:visited { text-decoration:none; color:#454545; }
a.subject:hover { color:#FF0000; text-decoration:none; }
a.subject:active { color:#FF0000; text-decoration:none; }

</style>

이렇게 해놓았고,
138 번 줄에

  <td height="25" style="font-size:12px; font-weight:bold; text-align:center; border-bottom:1px solid #d9d9d9;">
  &nbsp;<a href="<?=$s_href[$i][$j]?>" onmouseover="this.style.fontWeight='bold';this.style.color='#d30842';"  onmouseout="this.style.fontWeight='';this.style.color='';"><?=$s_menu[$i][$j]?>
  <span style="font-size:10px; color:#FF6600"><? if($new_c[$i][$j]) echo " (".$new_c[$i][$j].")";?></span></a></td>

이 부분에서 마우스오버 아웃 뒷편으로 class="subject" 도 붙여봤는데, 적용도 안되구요 ㅠㅠ

어찌 잘 안됩니다. ㅠㅠ 답답한 마음에 질문까지 올려봅니다~
마우스오버 색상과 마우스오버 아웃 색상 소스는 없어도 되고,
메뉴클릭시 .. 아 내가 이 게시판에서 글을 읽고 잇구나~ 라고 생각할수 잇게,
메뉴클릭시 색상변경만 빨간색으로 하면 되거든요..

왜이렇게 안되는지.. 뭐가 잘못됐는지 알수가 없네요.. ㅠㅠ

댓글 전체

<a href="<?=$s_href[$i][$j]?>" onmouseover="this.style.fontWeight='bold';this.style.color='#d30842';"  onmouseout="this.style.fontWeight='';this.style.color='';"><?=$s_menu[$i][$j]?>

부분을
<?
$menu_event = " onmouseover=\"this.style.fontWeight='bold';this.style.color='#d30842';\"  onmouseout=\"this.style.fontWeight='';this.style.color='';\"; ";
if($bo_table=="g4_qa"){$menu_event = " class='subject'"; }
else if($bo_table=="g4_qa1"){$menu_event = "  class='subject' "; }
?>
<a href="<?=$s_href[$i][$j]?>" ><?=$s_menu[$i][$j]?>

현재 위치를 알아야 메뉴선택이 되었는지 알수 있기때문에 조건문을 써주시면 되실듯 하고요
보통 게시판은 $bo_table 값이 넘어 오니 $bo_table 값으로
만약에 게시판이 아니면 상단에 $g4[title] 을 이용하시거나
아니면 $LMenu = "메뉴명"; 으로 정의하시고
else if($LMenu=="메뉴명"){$menu_event = "  class='subject' "; }
처리하시면 될듯 합니다
a.subject:hover { color:#FF0000; text-decoration:none; }
a.subject:active { color:#FF0000; text-decoration:none; }
스타일 격식이 문제가 있는같네요.

아래와 같이 해보세요.
.subject a:hover { color:#FF0000; text-decoration:none; }
.subject a:active { color:#FF0000; text-decoration:none; }
$s_menu[$j][$gr_bo_c[$j]] = $g4_board[$i][bo_subject]; 밑에
$s_table[$j][$gr_bo_c[$j]] = $g4_board[$i][bo_table]; 추가해주시고
----------------------------------------------------------------------
<style>
a.subject:link, a.subject:visited { text-decoration:none; color:#454545; }
a.subject:hover { color:#FF0000; text-decoration:none; }
a.subject:active { color:#FF0000; text-decoration:none; }
</style>

부분을

<style>
/* 해당 게시판이 아닐떄 */
a.subject:link, a.subject:visited { text-decoration:none; color:#454545; }
a.subject:hover { color:#FF0000; text-decoration:none; }
a.subject:active { color:#FF0000; text-decoration:none; }
/* 해당 게시판일때 */
a.subject_on:link, a.subject_on:visited { text-decoration:none; color:#ccc; }
a.subject_on:hover { color:#FF0000; text-decoration:none; }
a.subject_on:active { color:#FF0000; text-decoration:none; }
</style>

로 바꿔주시면서 원하시는 색상 넣으시면 되구요
-------------------------------------------------------------------------
  <td height="25" style="font-size:12px; font-weight:bold; text-align:center; border-bottom:1px solid #d9d9d9;">
  &nbsp;<a href="<?=$s_href[$i][$j]?>" onmouseover="this.style.fontWeight='bold';this.style.color='#d30842';"  onmouseout="this.style.fontWeight='';this.style.color='';"><?=$s_menu[$i][$j]?>
  <span style="font-size:10px; color:#FF6600"><? if($new_c[$i][$j]) echo " (".$new_c[$i][$j].")";?></span></a></td>

부분 (td~/td)을

  <td  height="20" style="border-bottom:1px solid #ebebeb;">
  &nbsp;<a href="<?=$s_href[$i][$j]?>" class="subject<?=($s_table[$i][$j]==$_GET['bo_table'])?'_on':''?>"><?=$s_menu[$i][$j]?>
  <span style="font-size:9px; color:#FF6600"><? if($new_c[$i][$j]) echo " (".$new_c[$i][$j].")";?></span></a></td>

로 바꾸어주세요

-------------------------------------------------------------------------

이건.. 제가 테스트를 못해봐서 작동안될가능성이 크나..

해보시고 쪽지주신다면 열심히 도와드리겠습니다 ^^*
전체 66,558 |RSS
그누4 질문답변 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT