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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
|
<!-- 메뉴 시작 --> <link href="<?php echo G5_PLUGIN_URL?>/jquery-mega-drop-down-menu/css/dcmegamenu.css" rel="stylesheet" type="text/css" /> <script type='text/javascript' src='<?php echo G5_PLUGIN_URL?>/jquery-mega-drop-down-menu/js/jquery.hoverIntent.minified.js'></script> <script type='text/javascript' src='<?php echo G5_PLUGIN_URL?>/jquery-mega-drop-down-menu/js/jquery.dcmegamenu.1.2.js'></script>
<div class="demo-container"> <ul id="mega-menu-1" class="mega-menu" style='z-index:15; '> <li id='show_all_cate_li'><!--<a id='show_all_cate'>≡ 카테고리 전체보기 </a>--> <img src='<?php echo G5_SHOP_URL?>/img/cate_all_img.png' id='show_all_cate'> </li> <?php for($i=0;$i<count($menu_array);$i++){ $menu_info = $menu_array[$i]; ?> <li ><a href="<?php echo $menu_info['me_link']?>" class='menu_ch_color'><?php echo $menu_info['me_name']?></a></li> <?php } ?> </ul>
<div id='show_cate_layer'> <div class="sub-container non-mega" style="left: 0px; z-index: 200;display:none;"> <ul class="sub" id='mega_menu_inner-1' style='position:relative;'> <?php for($i=0;$i<count($ca_array);$i++){ $ca_info = $ca_array[$i]; ?> <li id='<?php echo $ca_info['ca_id']?>'><a href="<?php echo G5_SHOP_URL."/list.php?ca_id=".$ca_info['ca_id']?>"><?php echo $ca_info['ca_name']?></a></li> <?php } ?> </ul> </div>
<?php for($i=0;$i<count($ca_array);$i++){ $ca_info = $ca_array[$i]; $sql = "select * from {$g5['g5_shop_category_table']} where ca_use = '1' and length(ca_id) = '4' and substr(ca_id,1,2) = '{$ca_info['ca_id']}' order by ca_order, ca_id "; $res2 = sql_query($sql); $ca_array2 = null; while($info2=sql_fetch_array($res2)){ $sql = "select * from {$g5['g5_shop_category_table']} where ca_use = '1' and length(ca_id) = '6' and substr(ca_id,1,4) = '{$info2['ca_id']}' order by ca_order, ca_id "; $res3 = sql_query($sql); while($info3=sql_fetch_array($res3)){ $info2['cate3'][] = $info3; } $ca_array2[] = $info2; } $ca_array[$i][sub] = $ca_array2; if(count($ca_array2)>0){ ?> <div class='mega_menu_2nd' id='mega_menu_ca_id_<?php echo $ca_info['ca_id']?>'> <span class='sub_cnt_span'><?php echo count($ca_array2);?></span> <!--<?php echo $ca_info['ca_name']?>--> <ul> <?php for($j=0;$j<count($ca_array2);$j++){ ?> <li> <div class='div_2nd'><a href="<?php echo G5_SHOP_URL."/list.php?ca_id=".$ca_array2[$j]['ca_id']?>"><?php echo $ca_array2[$j]['ca_name']?></a></div> <?php for($k=0;$k<count($ca_array2[$j]['cate3']);$k++){?> <div class='div_3nd'><a href="<?php echo G5_SHOP_URL."/list.php?ca_id=".$ca_array2[$j]['cate3'][$k]['ca_id']?>"><?php echo $ca_array2[$j]['cate3'][$k]['ca_name']?></a></div> <?php } ?> </li> <?php } ?> </ul> </div> <?php } } ?> </div> <!-- show_cate_layer 끝 --> <div id='all_category_show'> <table border=0 cellspacing=0 cellpadding=0> <tr> <?php $sub_html = ""; for($i=0;$i<count($ca_array);$i++){ $ca_info = $ca_array[$i]; if($i==0){ $sub_html = "<tr>"; } if($i%5==0 && $i<>0){ echo "</tr>".$sub_html."</tr><tr>"; $sub_html = "<tr>"; //break; } if(($i+1)%5==0 && $i<>0){ $th_td2 = 'th_td2'; } else { $th_td2 = ''; } ?> <td class='th_td td_bold <?php echo $th_td2?>'><a href="<?php echo G5_SHOP_URL."/list.php?ca_id=".$ca_info['ca_id']?>"><?php echo $ca_info['ca_name']?></a></td> <?php $sub_html .= "<td class='th_td {$th_td2}'><ul class='td_ul'>"; for($j=0;$j<count($ca_info['sub']);$j++){ $ca2_info = $ca_info['sub'][$j]; $sub_html .= "<li><a href='".G5_SHOP_URL."/list.php?ca_id=".$ca2_info['ca_id']."'>{$ca2_info['ca_name']}</a></li>"; /*for($j2=0;$j2<count($ca_info['sub'][$j]['cate3']);$j2++){ $ca3_info = $ca_info['sub'][$j]['cate3'][$j2]; $sub_html .= "<li><a href='".G5_SHOP_URL."/list.php?ca_id=".$ca3_info['ca_id']."'>{$ca3_info['ca_name']}</a></li>"; }*/ } $sub_html .= "</ul></td>"; } for($k=$i%5;$k<5;$k++){ if($k==4){ $th_td2 = 'th_td2'; } else { $th_td2 = ''; } $sub_html .= "<td class='th_td {$th_td2}'><ul><li></li></ul></td>"; ?> <td class='th_td <?php echo $th_td2;?>'> </td> <?php //_pr($k); } ?> <?php echo "</tr>".$sub_html."</tr>"; ?> </table> </div>
</div>
<?php //_pr($ca_array); ?>
<script> $(document).ready(function($){ /*$('#mega-menu-1').dcMegaMenu({ rowItems: '3', speed: 'fast', effect: 'fade' });*/
$('#mega_menu_inner-1 li').mouseover(function(){ var v = $(this).attr("id"); $(".mega_menu_2nd").hide(); $("#mega_menu_ca_id_"+v).show();
// li중에 가장 높은 갚을 기준으로 높이를 재 산정한다. var mm2nd_height = 0; $("#mega_menu_ca_id_"+$(this).attr("id")+" ul li").each(function(){ if(mm2nd_height<$(this).height()){ mm2nd_height = $(this).height();
} }); // 재 산정된 높이를 일괄적으로 적용한다. $("#mega_menu_ca_id_"+$(this).attr("id")+" ul li").each(function(){ $(this).height(mm2nd_height); });
// div 빠져나올때 숨기기 $("#mega_menu_ca_id_"+$(this).attr("id")).mouseleave(function(){ $(this).hide(); });
});
// 전체 $("#all_category_show").height($("#all_category_show table").height());
$("#show_cate_layer").mouseleave(function(){ //$("#show_cate_layer").hide(); });
// CSS 문제로 레이어를 안보이는 위쪽으로 올렸다가 보일때 해당 자리로 이동함 $("#show_all_cate").click(function(){ $("#show_cate_layer").hide(); $("#all_category_show").show(); $("#all_category_show").css("top","38px"); });
// 안보이는 위쪽의 레이어를 숨김 $("#all_category_show").mouseleave(function(){ $(this).hide(); });
/*var sc_height = $(".sub-container").height(); sc_height = sc_height+20 $("#show_cate_layer").height(sc_height+"px");*/
}); </script>
<style> .mega_menu_2nd {position:absolute;width:821px; border:1px solid gray; top:0px; left:210px;z-index:199; background:white; padding:8px; display:none} .mega_menu_2nd .sub_cnt_span { display:none; } .mega_menu_2nd ul { position:relative; } .mega_menu_2nd ul li { float:left; margin:5px;} .mega_menu_2nd ul li .div_2nd { padding:5px 10px 5px 10px;background:#F2F5F9; min-width:133px; font-weight:bold; color:#555; margin-bottom:10px; } .mega_menu_2nd ul li .div_3nd { padding:5px 10px 5px 10px; color:#444; }
#all_category_show {position:absolute; border:2px solid #424242; width:1046px; height:200px; background:white; z-index:210; display:; top:-5024px; } #all_category_show table { width:100%; } #all_category_show table .th_td { width:20%; height:30px; border-right:1px solid #e0e0e0; border-bottom:1px solid #e0e0e0; padding-left:15px;; vertical-align:top;} #all_category_show table .td_bold { font-weight:bold; background:#F6F7FB; vertical-align:middle;} #all_category_show table .th_td2 { border-right:0px solid #e0e0e0; padding-bottom:5px; }
.td_ul li {padding-top:5px; padding-bottom:5px; }
#show_all_cate { cursor:pointer; }
#mega_menu_inner-1 {position:absolute;} #mega_menu_inner-1 li { }
#show_cate_layer { position:absolute;border:0px solid red; width:1050px; height:1px; z-index:2200; padding-top:0px; display:;}
.sub-container { position: absolute; padding:10px; background:#d10000; margin-top:0px; } .sub { background: #d00000; padding: 25px; border: 0px solid #ccc; } .sub .row { width: 100%; overflow: hidden; clear: both; } .sub li { list-style: none; float: none; width: 170px; font-size: 1em; font-weight: normal; } .sub li.mega-hdr { margin: 0 10px 10px 0; float: left; } .sub li.mega-hdr.last { margin-right: 0; } .sub a { background: none; font-weight:bold; color: #eee; padding: 7px 10px; display: block; float: none; font-size: 1.0em; } .sub li.mega-hdr a.mega-hdr-a { padding: 5px 15px; margin-bottom: 5px; background: #6B6B6B; text-transform: uppercase; font-weight: bold; color: #fff; } .sub li.mega-hdr a.mega-hdr-a:hover { color: #000; } .sub li.mega-hdr li a { padding: 4px 5px; font-weight: normal; } .sub li.mega-hdr li a:hover { color: #a32403; background: #efefef; } .sub ul li { padding-right: 0; } .sub-container.non-mega .sub { padding: 10px; } .sub-container.non-mega li { padding: 0; width: 190px; margin: 0; } .sub-container.non-mega li a { padding: 7px 5px 7px 22px; } .sub-container.non-mega li a:hover { color: #a32403; background: #efefef; } </style> <!-- 메뉴 시작 끝 -->
<script type="text/javascript" src="<?php echo G5_PLUGIN_URL?>/ariamenu/fg.menu.js"></script> <link type="text/css" href="<?php echo G5_PLUGIN_URL?>/ariamenu/fg.menu.css" media="screen" rel="stylesheet" /> <link type="text/css" href="<?php echo G5_PLUGIN_URL?>/ariamenu/theme/ui.all.css" media="screen" rel="stylesheet" />
<!-- styles for this example page only --> <style type="text/css"> #flyout {display:;position:absolute;top:56px;left:-20px;z-index:10; } #menuLog { font-size:1.4em; margin:20px; } .hidden { position:absolute; top:0; left:-9999px; width:1px; height:1px; overflow:hidden; } .positionHelper { z-index:220; } .fg-button { clear:left; margin:0 4px 40px 20px; padding: .4em 1em; text-decoration:none !important; cursor:pointer; position: relative; text-align: center; zoom: 1; } .fg-button .ui-icon { position: absolute; top: 50%; margin-top: -8px; left: 50%; margin-left: -8px; } a.fg-button { float:left; } button.fg-button { width:auto; overflow:visible; } /* removes extra button width in IE */ .fg-button-icon-left { padding-left: 2.1em; } .fg-button-icon-right { padding-right: 2.1em; } .fg-button-icon-left .ui-icon { right: auto; left: .2em; margin-left: 0; } .fg-button-icon-right .ui-icon { left: auto; right: .2em; margin-left: 0; } .fg-button-icon-solo { display:block; width:8px; text-indent: -9999px; } /* solo icon buttons must have block properties for the text-indent to work */ .fg-button.ui-state-loading .ui-icon { background: url(spinner_bar.gif) no-repeat 0 0; } </style> <!-- style exceptions for IE 6 --> <!--[if IE 6]> <style type="text/css"> .fg-menu-ipod .fg-menu li { width: 95%; } .fg-menu-ipod .ui-widget-content { border:0; } </style> <![endif]--> <script type="text/javascript"> $(function(){ // or from an external source //$.get('<?php echo G5_PLUGIN_URL;?>/ariamenu/menuContent.html', function(data){ // grab content from another page $.get('<?php echo G5_SHOP_URL;?>/shop_menu_cate.inc.php', function(data){ // grab content from another page $('#show_all_cate').menu({ content: data, flyOut: true, width:176 }); });
}); </script>
<!--<script type="text/javascript" src="http://ui.jquery.com/applications/themeroller/themeswitchertool/"></script>--> <!--<script type="text/javascript"> $(function(){ $('<div style="position: absolute; top: 20px; right: 300px;" />').appendTo('body').themeswitcher(); }); </script>-->
|