PageSourceSearch

https://youthrun.co.kr/js/ui.js

js youthrun.co.kr collected 2026-10-08 12:27:43 UTC 6,914 bytes, 266 lines download raw bytes

1;(function($, window, undefined){
2	'use strict';
3	
4	if('undefined' === typeof window.UI){
5		var UI = window.UI = {};
6	}
7	$(function(){
8		Layout.bodyEvent();
9		Layout.conSize();
10		Layout.headGnb();
11		Layout.gnbPlus();
12		Layout.m_gnbNav();
13	});
14	
15	$(document).ready(function(){		
16		
17	});			
18	var Layout = UI.Layout = {
19		bodyEvent : function(){	
20			function inLoad(){
21				$("body").addClass("load");
22			}		
23			function inScroll(){
24				var scrollTop = $(window).scrollTop()
25				scrollTop > 0 ? $("body").addClass("scroll") : $("body").removeClass("scroll");
26			}
27			function inRes(){
28				var winW = $(window).width();
29				if(isMobile || winW <= 1024){
30					$("body").addClass("bodyMobile").removeClass("bodyPC");			
31				}else{
32					$("body").removeClass("bodyMobile").addClass("bodyPC");	
33				}
34			}
35			$(window).load(function(){
36				inLoad();
37			})
38			$(window).scroll(function(){
39				inScroll();				
40			});
41			$(document).ready(function(){
42				inScroll();
43				inRes();
44			});			
45			$(window).resize(function(){
46				inRes();
47			});
48		},
49		conSize : function(){			
50			function inEvent(){
51				var winW = $(window).width();
52				var winH = $(window).height();
53				var contents = $("#contents");
54				var headerH = $("#header").outerHeight();		
55				var footerH = $("#footer").outerHeight();
56				
57				contents.css({"min-height":winH - footerH});
58			}
59			
60			$(document).ready(function(){
61				inEvent();
62			});			
63			$(window).resize(function(){
64				inEvent();
65			});
66		},
67		headGnb : function(){
68			var obj = $("#header .gnb_wrap .gnb > li");
69			var header = $("#header");
70			function inScroll(){
71				if($("body").hasClass("scroll")){
72					header.addClass("active");
73				}else{
74					header.removeClass("active");
75					if(header.hasClass("gnbOpen")){
76						header.addClass("active");
77					};
78				}
79			}
80			function inReady(){
81				obj.mouseenter(function(){
82					header.addClass("active").addClass('gnbOpen');
83				}).mouseleave(function(){
84					header.removeClass('active').removeClass('gnbOpen');
85					if($("body").hasClass("scroll")){
86						header.addClass("active");
87					}
88				});			
89			}
90			$(window).scroll(function(){
91				inScroll();
92			});	
93			$(document).ready(function(){
94				inScroll();
95				inReady();
96			});			
97		},
98		gnbPlus : function(){
99			var obj = $(".gnb li");
100			obj.each(function(){
101				var leng = $(this).children("ul").children("li").length;
102				if(leng > 0){
103					$(this).addClass("plus");
104				}else{
105					$(this).removeClass("plus");
106				}
107				if(leng == 0){
108					$(this).children("ul").remove();
109				}
110			});
111		},
112		m_gnbNav : function(){	
113			var obj = $("#nav .gnb .dp1");
114			function inEvent(){
115				var winW = $(window).width();
116				obj.each(function(){
117					var leng = $(this).next(".dp2").find("li").length;					
118					if(isMobile || winW <= 1024){
119						if( leng > 0){		
120							$(this).attr("href","javascript:void(0)").addClass("arrow");
121							if($(this).attr("target")){
122								$(this).removeAttr("target")
123							}
124						}						
125					}else{	
126						obj.removeClass("arrow");
127						obj.parent("li").removeClass("active");
128					}
129				})
130			};			
131			obj.each(function(){
132				$(this).click(function(){
133					if($(this).hasClass("arrow")){				
134						$(this).parent("li").toggleClass("active");
135						$(this).parent("li").siblings("").removeClass("active");
136					}
137				})					
138			})
139			$(document).ready(function(){
140				inEvent();				
141			});			
142			$(window).resize(function(){
143				inEvent();
144			});
145		}
146	}
147	
148	var Motion = UI.Motion = {
149		scrollAni : function(){
150			var $obj = $( '*[data-animation]' );			
151			var winH = $(window).height()
152			$obj.each( function( i, el ) {
153				var $el = $( el ),
154					aniClass = $el.data('animation'),
155					$delay = $el.data('delay'),
156					$duration = $el.data('duration'),
157					check = true;
158				
159				if($delay>0){
160					$el.css({
161						'-webkit-animation-delay':$delay+'s',
162						'animation-delay':$delay+'s'
163					})
164				}
165				if($duration>0){
166					$el.css({
167						'-webkit-animation-duration':$duration+'s',
168						'animation-duration':$duration+'s'
169					})
170				}	
171				
172				var objT = $el.offset().top;
173				if(objT >= winH*0.9){
174					$el.addClass('wait-animation');
175				}
176				$el.addClass('animated '+aniClass);
177	
178				$el.waypoint(function(){					
179					if(check){
180						check = false;
181						$el.removeClass('wait-animation');							
182					}else{
183						//$el.toggleClass("on");						
184					};
185				}, { offset: '90%' });
186			});
187		},
188		ieFixed : function(){
189			var fix = function(){
190				if(navigator.userAgent.match(/Trident\/7\./)) {
191					$('body').on("mousewheel", function () {
192						event.preventDefault();			
193						var wheelDelta = event.wheelDelta;			
194						var currentScrollPosition = window.pageYOffset;
195						window.scrollTo(0, currentScrollPosition - wheelDelta);						
196					});
197				}
198			};			
199			
200			$.fn.extend({
201				mouse_wheel: function() {
202					$(this).on('mousewheel', function(e) {						
203						if (e.originalEvent.wheelDelta >= 120) {
204							this.scrollTop -= 50;
205						} else if (e.originalEvent.wheelDelta <= -120) {
206							this.scrollTop += 50;
207						}
208						return false;
209					});
210				}
211			});			 
212			
213			var winW = $(window).width();
214			if(!(isMobile) && !($('body').hasClass('pop')) && !(winW <= 1024)){				
215				fix();
216				$('.js_mouse_wheel').mouse_wheel();				
217				$('textarea').mouse_wheel();
218			}
219		},
220		skrInit : function(){
221			$(document).ready(function(){		
222				var skr = skrollr.init({
223					smoothScrolling: false,
224					forceHeight: false
225				});	
226			})
227		}	
228	}
229	var Slider = UI.Slider = {
230		mainVisual : function(){
231			var Wrap = $(".main_visual_wrap");
232			var SlideWrap = Wrap.find(".visual");			
233			SlideWrap.slick({
234				fade: true,
235				arrows: true,
236				dots: true,
237				autoplay: true,			
238				autoplaySpeed: 4000,
239				speed: 500,
240				appendDots: Wrap.find('.dot_wrap'),						
241				prevArrow: Wrap.find('.control_box .prev'),
242				nextArrow: Wrap.find('.control_box .next')				
243			});	
244			SlideWrap.on('afterChange',function(){
245				Wrap.find(".progress").addClass('proAni');
246			});
247			SlideWrap.on('beforeChange',function(){
248				Wrap.find(".progress").removeClass('proAni');
249			});
250			Wrap.find('.control_box .pause').clickToggle(function(){
251				SlideWrap.slick('slickPause');
252				$(this).find(".xi").removeClass("xi-pause").addClass("xi-play");
253			},function(){				
254				SlideWrap.slick('slickPlay');
255				$(this).find(".xi").removeClass("xi-play").addClass("xi-pause");
256			});
257			
258			SlideWrap.find('.el').eq(0).addClass('activeAni');			
259			SlideWrap.on('beforeChange', function(event, slick, currentSlide, nextSlide){				
260				SlideWrap.find('.el').removeClass('activeAni');
261				SlideWrap.find('.el').eq(nextSlide).addClass('activeAni');
262			});	
263		}
264	}	
265})(jQuery, window);
266

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.