PageSourceSearch

https://100bs.kr/gd_import/js/time_banner.js

js 100bs.kr collected 2026-10-09 01:34:28 UTC 5,423 bytes, 134 lines download raw bytes

1$(document).ready(function($) {
2	//console.log('dev');
3
4	//할인타입 (판매가,할인판매가)
5	$('.time_banner .layerDiscountPeriod').each(function(){
6		if($(this).find('.content p strong').text().indexOf('남은시간') > -1){ //할인중
7			var this_ = $(this);
8
9			var sale_time = this_.find('.content p:last-child').text().split('~');
10			var sale_time_start = sale_time[0].replace(/[^0-9]/g,'');
11			var sts_result = parseInt(sale_time_start.substring(4,6))+'/'+parseInt(sale_time_start.substring(6,8))+'/'+parseInt(sale_time_start.substring(0,4))+' '+parseInt(sale_time_start.substring(8,10))+':'+parseInt(sale_time_start.substring(10,12));
12			var sale_time_end = sale_time[1].replace(/[^0-9]/g,'');
13			var ste_result = parseInt(sale_time_end.substring(4,6))+'/'+parseInt(sale_time_end.substring(6,8))+'/'+parseInt(sale_time_end.substring(0,4))+' '+parseInt(sale_time_end.substring(8,10))+':'+parseInt(sale_time_end.substring(10,12));
14			CountDownTimer(ste_result, 'newcountdown');
15
16			function CountDownTimer(dt, id){
17				var end = new Date(dt);
18
19				var _second = 1000;
20				var _minute = _second * 60;
21				var _hour = _minute * 60;
22				var _day = _hour * 24;
23				var timer;
24
25				function showRemaining() {
26					var now = new Date();
27					var distance = end - now;
28					if (distance < 0) { //카운트다운종료
29						clearInterval(timer);
30						return;
31					}
32					var days = Math.floor(distance / _day);
33					var hours = Math.floor((distance % _day) / _hour);
34					var minutes = Math.floor((distance % _hour) / _minute);
35					var seconds = Math.floor((distance % _minute) / _second);
36
37					if((days+='').length < 2) days = days;
38					if((hours+='').length < 2) hours = '0'+hours;
39					if((minutes+='').length < 2) minutes = '0'+minutes;
40					if((seconds+='').length < 2) seconds = '0'+seconds;
41
42					var result = (hours + ':' + minutes + ':' + seconds);
43					this_.closest('.box').find('.countdown').html('<span>'+days+'</span>' + '일' + '<span>'+hours+'</span>' + '시' + '<span>'+minutes+'</span>' + '분' + '<span>'+seconds+'</span>' + '초');
44					this_.closest('.box').find('.day').text(days+'일');
45				}
46
47				timer = setInterval(showRemaining, 1000);
48			}
49
50			this_.closest('.box').find('.date-title .txt').text('남은시간');
51		} else if($(this).find('.content p strong').text().indexOf('전입니다') > -1){ //할인기간전
52			var this_ = $(this);
53
54			var sale_time = this_.find('.content p:last-child').text().split('~');
55			var sale_time_start = sale_time[0].replace(/[^0-9]/g,'');
56			var sts_result = parseInt(sale_time_start.substring(4,6))+'/'+parseInt(sale_time_start.substring(6,8))+'/'+parseInt(sale_time_start.substring(0,4))+' '+parseInt(sale_time_start.substring(8,10))+':'+parseInt(sale_time_start.substring(10,12));
57			var sale_time_end = sale_time[1].replace(/[^0-9]/g,'');
58			var ste_result = parseInt(sale_time_end.substring(4,6))+'/'+parseInt(sale_time_end.substring(6,8))+'/'+parseInt(sale_time_end.substring(0,4))+' '+parseInt(sale_time_end.substring(8,10))+':'+parseInt(sale_time_end.substring(10,12));
59			CountDownTimer(sts_result, 'newcountdown');
60
61			function CountDownTimer(dt, id){
62				var end = new Date(dt);
63
64				var _second = 1000;
65				var _minute = _second * 60;
66				var _hour = _minute * 60;
67				var _day = _hour * 24;
68				var timer;
69
70				function showRemaining() {
71					var now = new Date();
72					var distance = end - now;
73					if (distance < 0) { //카운트다운종료
74						clearInterval(timer);
75						return;
76					}
77					var days = Math.floor(distance / _day);
78					var hours = Math.floor((distance % _day) / _hour);
79					var minutes = Math.floor((distance % _hour) / _minute);
80					var seconds = Math.floor((distance % _minute) / _second);
81
82					if((days+='').length < 2) days = days;
83					if((hours+='').length < 2) hours = '0'+hours;
84					if((minutes+='').length < 2) minutes = '0'+minutes;
85					if((seconds+='').length < 2) seconds = '0'+seconds;
86
87					var result = (hours + ':' + minutes + ':' + seconds);
88					this_.closest('.box').find('.countdown').html('<span>'+days+'</span>' + '일' + '<span>'+hours+'</span>' + ':' + '<span>'+minutes+'</span>' + ':' + '<span>'+seconds+'</span>' + '<span class="white"> 남았어요</span>');
89					this_.closest('.box').find('.day').text(days+'일');
90				}
91
92				timer = setInterval(showRemaining, 1000);
93			}
94
95			this_.closest('.box').addClass('cover before');
96			this_.closest('.box').find('.date-title .txt').text('할인까지 남은시간');
97		}
98	});
99	$('.time_banner .box').each(function(){ //할인종료, 할인없는 상품진열 시
100		if(!$(this).find('.layerDiscountPeriod').length){
101			$(this).closest('.box').addClass('cover after');
102			$(this).closest('.box').find('.date-title .txt').text('할인종료');
103		}
104	});
105
106
107
108	//썸네일슬라이드
109	$('.add-thumb .swiper-slide img').each(function(){
110		if(!this.complete || typeof this.naturalWidth == 'undefined' || this.naturalWidth == 0){
111			$(this).parent().remove();
112		}
113	});
114
115	var addThumb = new Swiper('.add-thumb',{
116		speed: 400,
117		loop: false,
118		effect: 'slide',
119		simulateTouch: false,
120		pagination: {
121			el: '.add-thumb .pagination',
122			type: 'bullets',
123			clickable: true
124		}
125	});
126	$('.box').each(function(){
127		if($(this).find('.swiper-slide').length > 1){
128			$(this).find('.add-thumb-wrap').addClass('active');
129		}
130	});
131	$('.add-thumb .pagination .swiper-pagination-bullet').on('mouseenter', function() {
132		$(this).trigger('click');
133	});
134});

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.