메뉴 건너뛰기

2016.09.21 18:14

간단한 세로 메뉴

조회 수 8773 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄 첨부
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄 첨부
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">


<html>


<head>


    <title> New Document </title>


    <script src="http://code.jquery.com/jquery-1.9.1.js"></script>


    <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>


</head>


<script>


    $(function() {


        $('.hide').hide();


        hide_func();


 


        $('[class^=menu]').hover(


            function() {


                hide_func();


                $('[class^=menu]').css('background', '');


                var nm = $(this).attr('class');


                $(this).css('background', 'red');


                //alert(nm);


                $('#'+nm).show();


            },


            function() {


                var nm = $(this).attr('class');


                //alert(nm);


                if($('#'+nm).is(':hidden'))


                    $('.hide').hide();


            }


        );


 


        $('[class^=submenu]').hover(


            function() {


                $('.submenu').css('background', '');


                var idx = $('.submenu').index(this);


                //alert(idx);


                $('.submenu:eq('+idx+')').css('background', 'pink');


                $('ul.hide').hide();


                $('.submenu:eq('+idx+')>ul.hide').show();


            }, 


            function() {


            }


        );


 


        $('.hide>li').hover(


            function() {


                $('.hide li').css('background', '');


                var idx = $('.hide>li').index(this);


                $('.hide li:eq('+idx+')').css('background', 'gold');


            },


            function() {


                //$('.hide li').css('background', '');


            }


        );


    });


 


    function hide_func() {


        $('[id^=menu]').hide();


        $('ul.hide').hide();


    }


</script>


 


<body>


    <div style='position: absolute;'>


        <ul>


            <li class='menu1'>menu1</li>


            <li class='menu2'>menu2</li>


            <li class='menu3'>menu3</li>


            <li class='menu4'>menu4</li>


            <li class='menu5'>menu5</li>


        </ul>


 


        <div id='menu1' style='position: relative; top: -110px; left: 100px;'>


            <ul>


                <li class='submenu'>submenu1


                    <ul class='hide'>


                        <li>submenu1_1</li>


                        <li>submenu1_2</li>


                        <li>submenu1_3</li>


                    </ul>


                </li>


                <li class='submenu'>submenu2


                    <ul class='hide'>


                        <li>submenu1_1</li>


                        <li>submenu1_2</li>


                        <li>submenu1_3</li>


                    </ul>


                </li>


                <li class='submenu'>submenu3


                    <ul class='hide'>


                        <li>submenu1_1</li>


                        <li>submenu1_2</li>


                        <li>submenu1_3</li>


                    </ul>


                </li>


            </ul>


        </div>


        <div id='menu2' style='position: relative; top: -90px; left: 100px;'>


            <ul>


                <li class='submenu'>submenu1


                    <ul class='hide'>


                        <li>submenu1_1</li>


                        <li>submenu1_2</li>


                        <li>submenu1_3</li>


                    </ul>


                </li>


                <li class='submenu'>submenu2


                    <ul class='hide'>


                        <li>submenu1_1</li>


                        <li>submenu1_2</li>


                        <li>submenu1_3</li>


                    </ul>


                </li>


                <li class='submenu'>submenu3


                    <ul class='hide'>


                        <li>submenu1_1</li>


                        <li>submenu1_2</li>


                        <li>submenu1_3</li>


                    </ul>


                </li>


            </ul>


        </div>


        <div id='menu3' style='position: relative; top: -70px; left: 100px;'>


            <ul>


                <li class='submenu'>submenu1


                    <ul class='hide'>


                        <li>submenu1_1</li>


                        <li>submenu1_2</li>


                        <li>submenu1_3</li>


                    </ul>


                </li>


                <li class='submenu'>submenu2


                    <ul class='hide'>


                        <li>submenu1_1</li>


                        <li>submenu1_2</li>


                        <li>submenu1_3</li>


                    </ul>


                </li>


                <li class='submenu'>submenu3


                    <ul class='hide'>


                        <li>submenu1_1</li>


                        <li>submenu1_2</li>


                        <li>submenu1_3</li>


                    </ul>


                </li>


            </ul>


        </div>


        <div id='menu4' style='position: relative; top: -50px; left: 100px;'>


            <ul>


                <li class='submenu'>submenu1


                    <ul class='hide'>


                        <li>submenu1_1</li>


                        <li>submenu1_2</li>


                        <li>submenu1_3</li>


                    </ul>


                </li>


                <li class='submenu'>submenu2


                    <ul class='hide'>


                        <li>submenu1_1</li>


                        <li>submenu1_2</li>


                        <li>submenu1_3</li>


                    </ul>


                </li>


                <li class='submenu'>submenu3


                    <ul class='hide'>


                        <li>submenu1_1</li>


                        <li>submenu1_2</li>


                        <li>submenu1_3</li>


                    </ul>


                </li>


            </ul>


        </div>


        <div id='menu5' style='position: relative; top: -30px; left: 100px;'>


            <ul>


                <li class='submenu'>submenu1


                    <ul class='hide'>


                        <li>submenu1_1</li>


                        <li>submenu1_2</li>


                        <li>submenu1_3</li>


                    </ul>


                </li>


                <li class='submenu'>submenu2


                    <ul class='hide'>


                        <li>submenu1_1</li>


                        <li>submenu1_2</li>


                        <li>submenu1_3</li>


                    </ul>


                </li>


                <li class='submenu'>submenu3


                    <ul class='hide'>


                        <li>submenu1_1</li>


                        <li>submenu1_2</li>


                        <li>submenu1_3</li>


                    </ul>


                </li>


            </ul>


        </div>


    </div>


</body>


</html>

메뉴에 마우스 오버시 선택된 메뉴 색상 변경

 

 

실행화면





  1. No Image 21Sep
    by
    2016/09/21 Views 6916 

    jQuery Cookie

  2. 슬라이드 쇼

  3. No Image 21Sep
    by
    2016/09/21 Views 9194 

    select box 값 변경, 목록 변경

  4. No Image 21Sep
    by
    2016/09/21 Views 6876 

    document.getElementById() 처럼 DOM 객체 얻기

  5. No Image 21Sep
    by
    2016/09/21 Views 6857 

    Input TYPE=“File” 을 히든으로 하고 외부 버튼을 눌러서 파일을 선택

  6. No Image 21Sep
    by 조쉬
    2016/09/21 Views 8773 

    간단한 세로 메뉴

  7. No Image 21Sep
    by
    2016/09/21 Views 8637 

    Get방식 파라미터 전송 & 탭 메뉴 선택

  8. 이미지 클릭시 확대하기

  9. jQuery Quick API

  10. No Image 11Sep
    by
    2016/09/11 Views 8970 

    [jQuery] 이용 아이디 중복체크 실시간

  11. No Image 11Sep
    by
    2016/09/11 Views 7018 

    jquery function 생성

  12. No Image 11Sep
    by
    2016/09/11 Views 7495 

    jquery 이용한 이미지 변환

  13. No Image 11Sep
    by
    2016/09/11 Views 7236 

    [jQuery Plugin] FCKeditor 2.6.5 사용법

  14. jqGrid / custom pager / custom paging / 그리드 / 페이징

  15. No Image 09Sep
    by
    2016/09/09 Views 9564 

    각종 다이어그램 플러그인 / 차트 / 관계 플러그인

  16. No Image 09Sep
    by
    2016/09/09 Views 7208 

    벨리데이션 체크 / validator / 자동 입력 제한

  17. No Image 09Sep
    by
    2016/09/09 Views 7795 

    강제 click 이벤트 발생

  18. No Image 09Sep
    by
    2016/09/09 Views 8108 

    ajax 아작스 통신

  19. No Image 09Sep
    by
    2016/09/09 Views 8232 

    jquery selector / jquery 선택자 / 자주 사용하는 jquery selector 선택자 / selecter

Board Pagination Prev 1 ... 4 5 6 7 8 9 Next
/ 9

하단 정보를 입력할 수 있습니다

© k2s0o1d4e0s2i1g5n. All Rights Reserved