Subversion-Projekte lars-tiefland.webanos.zeldi.de

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
4 lars 1
<script type="text/javascript" src="/JavaScript/jquery.hoverIntent.min.js"></script>
2
<script>
3
    $(document).ready(function(){
4
        var windowWidth = $(window).width();
5
        removeMobileNav(windowWidth);
6
 
7
        $(".topnav_ul li").hoverIntent(
8
            function(){
9
                var topLvl = String( $(this).attr("class") );
10
 
11
                var topExpl = topLvl.split("_");
12
                var topId = topExpl[1];
13
                $(this).removeClass('highlight');
14
 
15
                if( windowWidth > 850){
16
                    $('.subnav').removeClass("topnav-hover");
17
                    $('.sub_'+topId).addClass("topnav-hover");
18
                    $(".topnav_ul li").removeClass('highlight');
19
                }
20
            }, function(){
21
                var topLvl = String( $(this).attr("class") );
22
                var topExpl = topLvl.split("_");
23
                var topId = topExpl[1];
24
                $('.sub_'+topId).removeClass("topnav-hover");
25
                $(".topnav_ul li").removeClass('highlight');
26
            }
27
 
28
        );
29
 
30
        $(".opener").hoverIntent(
31
            function(){
32
                $('.opener').removeClass("highlight");
33
                $('.subdir_box').hide();
34
                let id = $(this).attr("id");
35
                $(this).addClass("highlight");
36
                $('#sub_'+id).css("display","flex");
37
            }, function(){
38
 
39
            }
40
 
41
        );
42
 
43
 
44
        $(".subnavClose").on( "click", function(){
45
            $('.subnav').removeClass("topnav-hover");
46
            $('.subnav').css("visibility", "hidden");
47
        });
48
 
49
        // height subnav
50
        /*
51
        var maxHeight = 0;
52
        $(".subnav_inner_container").each(function(){
53
            var actHeight = $(this).height();
54
 
55
            if( maxHeight == 0 ){
56
                maxHeight = actHeight;
57
            }else{
58
                if( maxHeight < actHeight ){
59
                    maxHeight = actHeight;
60
                }
61
            }
62
        });
63
        if( maxHeight > 0 ){
64
            $(".subnav_inner_container").css("height", maxHeight + 30);
65
        }
66
        */
67
 
68
        function removeMobileNav(w) {
69
            if(w>850) {
70
                $('.mobileNav').remove();
71
            }
72
        }
73
    });
74
</script>
75
<style>
76
 
77
.subnav {
78
    width:100%;
79
    left:0;
80
    margin:-5px auto 0;
81
    border-bottom:2px solid #ccc;
82
    min-height:50vh!important;
83
    font-size:1.15rem;
84
}
85
.subnav_outer_container {
86
    margin:0 auto;
87
    float:none;
88
    width:70%;
89
}
90
.sub_2400 {
91
    /*visibility:unset;*/
92
}
93
.subs {
94
    width:69%;
95
    transition:all 200ms ease;
96
}
97
.sub2 {
98
    display:flex;
99
}
100
.sub_head {
101
    display: flex;
102
    flex-direction: row;
103
    justify-content: space-between;
104
    align-items: center;
105
    margin:1px 0;
106
}
107
.topnav_next {
108
    text-align:right;
109
}
110
.sub2 a,
111
.subhead a {
112
    padding:4%;
113
    width:92%;
114
    border-radius:5px;
115
    cursor:pointer;
116
}
117
.subnav a {
118
    border-radius:5px;
119
    display: block;
120
    width: 100%;
121
}
122
.subnav_paddings:hover .subdir_box {
123
    display:flex;
124
}
125
.subs .subnav-hover {
126
    display:flex;
127
}
128
.subs .subdir_box {
129
    display:none;
130
    flex-wrap:wrap;
131
    transition:all 200ms ease;
132
    column-gap:20px;
133
}
134
.subs .subdir_box span {
135
    min-width:calc(33.33% - 20px);
136
    transition:all 200ms ease;
137
}
138
.opener.highlight,
139
.opener:hover,
140
.opener:focus {
141
    background:#f4f4f4;
142
    border-radius:5px;
143
}
144
.fa-chevron-right {
145
    color:#e95802;
146
    margin-top:2px;
147
}
148
</style>
149
<nav class="topnav noprint">
150
    <div class="inner">
151
 
152
 
153
        {*
154
        {if $herstellerInMenu|is_array}
155
        <li id="li_one" style="cursor:pointer;">
156
            <a class="topnav_li" id="one">Marken</a>
157
            <div id="topnav_active_one" class="topnav_active desktop"></div>
158
        </li>
159
        {/if}
160
        *}
161
 
162
        <ul class="topnav_ul">
163
        {foreach $nav as $n name=navigation}
164
 
165
            {foreach $n.top as $top }
166
            <li class="{if $n@last}last{/if} li_{$top.id}">
167
                <a class="topnav_li" id="{$top.id}" href="{$top.dirLink}" title="Zu {$top.name}">{$top.name}</a>
168
            </li>
169
            {/foreach}
170
        {/foreach}
171
        </ul>
172
    </div>
173
        {foreach $nav as $n}
174
 
175
            {foreach $n.top as $top}
176
                {if is_array($n.sub) && $n.sub|count}
177
                <div class="subnav sub_{$top.id}">
178
                   <div class="subnav_outer_container">
179
 
180
                        <div class="subnav_inner_container">
181
                          <div class="subnav_paddings">
182
 
183
                            <div class="subdir_col">
184
                                {* 1st level opener *}
185
                                {section loop=$n.sub start=0 name=s_ind}
186
                                    {if $n.sub[s_ind].link}
187
                                        <div id="{$n.sub[s_ind].id}" class="opener {if $smarty.section.s_ind.last}subdir_last{/if}">
188
                                            <span class="sub_head"><a href="{$n.sub[s_ind].link}" title="Zu {$n.sub[s_ind].name}">{$n.sub[s_ind].name}</a>
189
                                                {if count($n.sub[s_ind].sub2)}
190
                                                    <a href="{$n.sub[s_ind].link}" class="topnav_next" data-closename="{$top.name}" data-id="sub2_{$n.sub[s_ind].id}" data-name="{$n.sub[s_ind].name}"><i class="fa fa-chevron-right" aria-hidden="true"></i></a>
191
                                                {/if}
192
                                            </span>
193
                                        </div>
194
                                    {/if}
195
                                {/section}
196
 
197
                            </div>
198
 
199
                            <div class="subdir_col subs">
200
 
201
                                {* 1st level *}
202
                                {section loop=$n.sub start=0 name=s_ind}
203
                                <div id="sub_{$n.sub[s_ind].id}" class="subdir_box {if $smarty.section.s_ind.last}subdir_last{/if}">
204
 
205
                                        {if is_array($n.sub[s_ind].sub2) && $n.sub[s_ind].sub2|count>0}
206
                                        {foreach $n.sub[s_ind].sub2 as $sub3}
207
                                            <span id class="sub2"><a href="{$sub3.link}" title="Zu {$sub3.name}">{$sub3.name}</a></span>
208
                                        {/foreach}
209
                                        {/if}
210
                                </div>
211
                                {/section}
212
                            </div>
213
 
214
                            {*
215
                            {if !$smarty.session.isMobile}
216
                            <div class="subnav_special">
217
 
218
                            </div>
219
                            {/if}
220
                            *}
221
 
222
 
223
                           </div>
224
                        </div>
225
                    </div>
226
                </div>
227
                {/if}
228
            {/foreach}
229
        {/foreach}
230
 
231
</nav>