자바질문입니다!

자바질문입니다!

QA

자바질문입니다!

본문

http://kimcare07.cafe24.com/shopinfo/asktax.html

 

여기가 제가 만든 페이지인데요

세금계산서 버튼을 누르고 나서 마우스를 다른곳으로 치우면

하단의 설명페이지가 지워집니다.

마우스가 어디에 있든 설명페이지가 고정되었으면 좋겠습니다.

 

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

var old_viewid = 0;
function menu_view(viewid){
 if(viewid!=old_viewid){
  document.getElementById("submenu"+viewid).style.display="block";
  if(old_viewid!="0")document.getElementById("submenu"+old_viewid).style.display="none";
  old_viewid = viewid;
 }
}

function menu_hide(hideid){
 document.getElementById("submenu"+hideid).style.display="none";
 old_viewid = 0;
}
       
window.onload = function()
{ menu_view(1);}  
</script>
</head>
   
<style>

 

<div id="buttonn01">
    <ul>
        <li onmouseover="javascript:menu_view(1);" onmouseout="javascript:menu_hide(1);">
           <a href='#' id="button" class='button1'>세금계산서출력안내</a>
            <ul id="submenu1" class="submenu1" onmouseover="javascript:menu_view(2);" onmouseout="javascript:menu_hide(1);">
                <li class="submenu"><a href="#"><img src="/SkinImg/asktax/01.jpg" alt="세금계산서출력안내"></a></li>
            </ul>
        </li>
       
        <li onmouseover="javascript:menu_view(2);" onmouseout="javascript:menu_hide(2);">
            <a href='#' id="button" class='button2'>현금영수증출력안내</a>
            <ul id="submenu2" class="submenu2" onmouseout="javascript:menu_hide(2);">
                <li class="submenu"><a href="#"><img src="/SkinImg/asktax/02.jpg" alt="현금영수증출력안내"></a></li>
            </ul>
        </li>
       
        <li onmouseover="javascript:menu_view(3);" onmouseout="javascript:menu_hide(3);">
            <a href='#' id="button" class='button3'>견적서출력안내</a>
            <ul id="submenu3" class="submenu3" onmouseout="javascript:menu_hide(3);">
                <li class="submenu"><a href="#"><img src="/SkinImg/asktax/03.jpg" alt="견적서출력안내"></a></li>
            </ul>
        </li>
       
        <li onmouseover="javascript:menu_view(4);" onmouseout="javascript:menu_hide(4);">
            <a href='#' id="button" class='button4'>카드전표출력안내</a>
            <ul id="submenu4" class="submenu4" onmouseout="javascript:menu_hide(4);">
                <li class="submenu"><a href="#"><img src="/SkinImg/asktax/04.jpg" alt="카드전표출력안내"></a></li>
            </ul>
        </li>

 <li onmouseover="javascript:menu_view(5);" onmouseout="javascript:menu_hide(5);">
            <a href='#' id="button" class='button5'>거래명세서출력안내</a>
            <ul id="submenu5" class="submenu5" onmouseout="javascript:menu_hide(5);">
                <li class="submenu"><a href="#"><img src="/SkinImg/asktax/05.jpg" alt="거래명세서출력안내"></a></li>
            </ul>
        </li>
    </ul>
</div>​​

이 질문에 댓글 쓰기 :

답변 1

function menu_view(viewid){

 if(viewid!=old_viewid){
  document.getElementById("submenu"+viewid).style.display="block";
  if(old_viewid!="0")document.getElementById("submenu"+old_viewid).style.display="block";
  old_viewid = viewid;

 } 

 

테스트는 안해 봤음...

답변을 작성하시기 전에 로그인 해주세요.
전체 294
QA 내용 검색

회원로그인

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