Notice
Recent Posts
Recent Comments
Link
«   2024/03   »
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31
Archives
Today
Total
관리 메뉴

web sprit

topmenu 만들기(2depth 나오고 소메뉴 높이에 따라 100% bg도 height값 늘어남) 본문

스크립트/J-Query

topmenu 만들기(2depth 나오고 소메뉴 높이에 따라 100% bg도 height값 늘어남)

커드만 2014. 9. 11. 20:07

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<script type="text/javascript">
    $(document).ready(function(){  
        
        $(".main_lnb_li .main_lnb_a").hover(function() { //마우스를 topnav에 오버시
 
            var dp_height = $(this).parent().find(".main_lnb02_ul").height();
 
            dp_height = parseInt(dp_height) + 61;
            $(".main_dp2_100per_bg").css("padding-bottom",dp_height); //subnav가 내려옴.
            $(".main_dp2_100per_bg").addClass("new_main_header_wrap");
            $(this).parent().find(".main_lnb02_ul").show(); //subnav가 내려옴.
 
 
            $(this).parent().hover(function() {  
            }, function(){  
                $(this).parent().find(".main_lnb02_ul").hide(); //subnav에서 마우스 벗어났을 시 원위치시킴 
                $(".main_dp2_100per_bg").css("padding-bottom","0");    
                $(".main_dp2_100per_bg").removeClass("new_main_header_wrap");
            });  
        });  
        
    });
</script>


topmenu 에서 가로 100%인 bg를 나타낼때 쓰면 된다.

기타 그밖에 내용은 수정하여 사용.

Comments