PageSourceSearch

https://www.infralab.net/front/template/default/js/jquery.gnb.js

js infralab.net collected 2026-10-04 03:32:05 UTC 2,668 bytes, 100 lines download raw bytes

1jQuery(function(jQuery){
2	jQuery.fn.gnb = function(options) {
3		var opts = jQuery.extend(options);
4		var gnb = jQuery(this);
5		var gnbList = gnb.find('>ul>li');
6		var submenu = gnb.find('.submenu');
7		var submenuList = submenu.find('ul>li');
8		var submenuBg = jQuery('.submenu_bg');
9
10		function showMenu() {
11			t = jQuery(this).parent('li');
12			if (!t.hasClass('active')) {
13				gnbList.removeClass('active');
14				t.addClass('active');
15
16				submenuList.bind("focus mouseover",function(){
17				jQuery(this).addClass('on');
18				});
19				submenuList.bind("mouseleave",function(){
20					jQuery(this).removeClass('on');
21				});
22			}
23			submenu.hide();
24			submenuList.bind("focus mouseover",function(){
25				jQuery(this).addClass('on');
26			});
27			submenuList.bind("mouseleave",function(){
28				jQuery(this).removeClass('on');
29			});
30
31			
32			submenuBg.stop(true, false).animate({height:50},200, 'swing',function(){
33					submenuBg.hide();		
34					t.find('.submenu').fadeIn(200);
35			});
36			if(t.find('div').hasClass('submenu')){
37				submenu.hide();
38				submenuBg.show();
39				submenuBg.stop(true, false).animate({height:50},200, 'swing',function(){
40					
41					t.find('.submenu').fadeIn(200);
42				});
43				return false
44			}	
45		}
46
47		function showMenu2() {
48			t = jQuery(this).parent('li');
49			if (!t.hasClass('active')) {
50				gnbList.removeClass('active');
51				t.addClass('active');
52				if(t.find('div').hasClass('submenu')){
53					submenu.hide();
54					submenuBg.show();					
55					submenuBg.stop(true, false).animate({height:50},200, 'swing',function(){
56						t.find('.submenu').fadeIn(200);
57					});
58					return false
59				}				
60			}			
61		}
62
63		function hideMenu() {
64			gnbList.removeClass('active');
65			submenu.fadeOut(100);
66			submenuBg.stop(true, false).delay(100).animate({height:'0'},200, 'swing', function(){
67				submenuBg.hide();			
68			});
69			activeMenu();
70		}
71
72		function activeMenu() {
73			if(opts.d1) {
74				t = gnbList.eq(opts.d1-1); 
75				t.addClass('active');
76				if(t.find('div').hasClass('submenu')){
77					submenuBg.show();
78					submenuBg.stop(true, false).animate({height:62},200, 'swing',function(){
79						t.find('.submenu').fadeIn(200);
80					});
81				}
82				if(opts.d2) {
83					t.find('.submenu>ul>li').eq(opts.d2-1).addClass('on');
84				}
85			}
86		}
87
88		return this.each(function() {
89			activeMenu();
90			var isTablet = navigator.userAgent.match(/(iPhone|iPod|iPad|Android|BlackBerry|Windows Phone)/);
91			if( !isTablet ){
92				gnbList.find('>a').mouseover(showMenu).focus(showMenu);
93			}else{
94				gnbList.find('>a').click(showMenu2);
95			}
96			
97			gnb.mouseleave(hideMenu);
98		});
99	}
100});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.