링크를 누루면 페이지로 넘어갓을때 색상이 바뀌는 소스좀 알려주세요

2017-05-14 (일) 05:50:46 6,630

그누보드 상단메뉴를 직접 수정중인데

f92b3ddddfdb60fb6cf7e1d7e09aa84c_1494708378_7809.JPG
 

이런식으로 링크를 클릭하면 페이지가 넘어가면서 색상이 자동으로 바뀌는것을 못하겠네요

용어도 모르는데 다른싸이트 보니 링크 클릭하면 뒤에 class="on" ​뒤에 이런식으로 붙더라고요

어떻게 어디서 부터해야하는지 모르겠네요

Copy
<script type="text/javascript">//클릭된 메뉴를 기억하기 위한 전역변수var _clickedMenu=""; //메뉴 클릭시 작동function changeTextColor(clickedMenu) { //모든 메뉴를 검정색으로 변경 document.getElementById("m_home").style.color="#000000"; document.getElementById("m_about").style.color="#000000"; document.getElementById("m_product").style.color="#000000"; document.getElementById("m_gallery").style.color="#000000"; document.getElementById("m_blog").style.color="#000000"; document.getElementById("m_contact").style.color="#000000"; //클릭한메뉴를 빨강으로 변경 clickedMenu.style.color="#ff0000"; //클릭한메뉴를 전역변수에 저장 _clickedMenu=clickedMenu.text;}//메뉴에 마우스 오버시 작동function setOnColor(hoveredMenu) { //폰트색을 빨강으로 변경 hoveredMenu.style.color="#ff0000";}//메뉴에 마우스 아웃시 작동function setOutColor(outedMenu) { //마우스 아웃한 메뉴가 클릭한 메뉴라면 함수를 바로 빠져나온다. if(outedMenu.text==_clickedMenu) return false; //색깔을 검정으로 변경 outedMenu.style.color="#000000";}</script></head><body><div class="menu_frame"> <div class="menu_group">  <a href="home.html" target="frame1" id="m_home" onclick="changeTextColor(this);" onmouseover="setOnColor(this);" onmouseout="setOutColor(this);">HOME</a>  <a href="about.html" target="frame1" id="m_about" onclick="changeTextColor(this);" onmouseover="setOnColor(this);" onmouseout="setOutColor(this);">ABOUT</a>  <a href="home.html" target="frame1" id="m_product" onclick="changeTextColor(this);" onmouseover="setOnColor(this);" onmouseout="setOutColor(this);">PRODUCT</a>  <a href="home.html" target="frame1" id="m_gallery" onclick="changeTextColor(this);" onmouseover="setOnColor(this);" onmouseout="setOutColor(this);">GALLERY</a>  <a href="home.html" target="frame1" id="m_blog" onclick="changeTextColor(this);" onmouseover="setOnColor(this);" onmouseout="setOutColor(this);">BLOG</a>  <a href="home.html" target="frame1" id="m_contact" onclick="changeTextColor(this);" onmouseover="setOnColor(this);" onmouseout="setOutColor(this);">CONTACT</a> </div></div><div class="contents"> <iframe width="1024" height="768" name="frame1"></iframe></div>


그나마 하나 찾았는데 마지막에 프레임이 문제인가

어떻게 연결해야하는지도 모르겠네요..


고수분들 소스좀 만들어주시거나 좋은 예제가 있으면 알려주십세요 꾸벅~

|

답변 2개 / 댓글 1개

2017-05-14 (일) 10:09:54

그누보드5 기본형에는 현재위치를 나타내는 소스가 포함되어 있지 않습니다.

http://webdir.tistory.com/452 에 적어둔 팁이 있는데 참고가 되실지 모르겠네요. 

해당 파라미터 또는 해당 URL 로 검사해서 만드는 프로세스를 구축해야 합니다.

답변에 대한 댓글 1개

2017-05-14 (일) 09:41:51
어디서 어떻게 해야하는지... 완전 초보라서요

답변을 작성하려면 로그인이 필요합니다.