PageSourceSearch

https://goslings.com/wp-content/themes/Goslings-SDK-V4/custom.js?var=1790941176

js goslings.com collected 2026-10-02 11:40:25 UTC 13,247 bytes, 563 lines download raw bytes

1var $ = jQuery.noConflict();
2
3$(function(){
4	
5	
6	
7	//ICONO DE CARRITO PARA NUEVA PAGINA DE LA API
8	
9		$('.header_icon_cart').prepend('<div class="ctcn_icon" liquid-cart-icon></div>');
10	$('[data-id="0b44557"] .elementor-widget-wrap').prepend('<div class="ctcn_icon" liquid-cart-icon></div>');
11	
12	$('[liquid-cart-icon]').on('click', function(){
13	   liquidSDK.cart.show();			
14    });
15		
16	
17	 
18	$(".animat_2").mouseenter(function() {
19		 $(this).addClass('active_1');
20		 setTimeout(function(){
21			 $('.animat_2').removeClass('active_1');
22			 $('.animat_2').addClass('active_2');
23		 }, 1000);
24	}).mouseleave(function() {
25		 $(this).removeClass('active_1 active_2');
26	});
27	
28	$('.fst_slider').slick({
29		  infinite: true,
30		  slidesToShow: 1,
31		  slidesToScroll: 1,
32		  autoplay: false,
33		  arrows: true,
34		  draggable: true,
35		  fade: true,
36		  cssEase: 'ease-in-out',
37		  responsive: [
38			{
39				breakpoint: 981,
40				settings: {
41					 adaptiveHeight: true
42				}
43			}
44		 ]
45	});  
46	$('.fst_slider').on('beforeChange', function(event, slick, currentSlide, nextSlide){
47		if(currentSlide == 1){
48			$('.fst_slider').addClass('active');
49		}else{
50			$('.fst_slider').removeClass('active');
51		}
52	});
53	
54	
55	$('.lptp_slider').slick({
56		  infinite: true,
57		  slidesToShow: 6,
58		  slidesToScroll: 1,
59		  autoplay: false,
60		  arrows: false, 
61		  responsive: [
62			 {
63				breakpoint: 9999,
64				settings: "unslick"
65			},
66			{
67				breakpoint: 1025,
68				settings: {
69					 slidesToShow: 4.2,
70				}
71			},
72			{
73				breakpoint: 767,
74				settings: {
75					 slidesToShow: 3.2,
76				}
77			},
78			{
79				breakpoint: 680,
80				settings: {
81					 slidesToShow: 2.2,
82				}
83			}
84		 ]
85	});
86	
87	var time_line = $('.txtimg_slider');
88	time_line.slick({
89		  infinite: true,
90		  slidesToShow: 1,
91		  slidesToScroll: 1, 
92		  arrows: true,
93		  responsive: [
94			{
95				breakpoint: 768,
96				settings: {
97					 adaptiveHeight: true
98				}
99			}
100		 ]
101	});
102	$('.txtimg_slider').on('beforeChange', function(event, slick, currentSlide, nextSlide){
103		var img = $('.text_with_image').data('img_'+nextSlide);
104		if(typeof img !== 'undefined')
105		$('.text_with_image').css('background-image', 'url(' + img + ')'); 
106		
107		if(nextSlide == 3){
108			$('.txtimg_section').addClass('green_active');
109		}else{
110			$('.txtimg_section').removeClass('green_active');
111		}
112	});
113	
114	$('.ttli_item').on('click', function(){
115		$('.ttli_item').removeClass('active');
116		$(this).addClass('active');
117		var id = $(this).data('id');
118		time_line.slick('slickGoTo', id);
119	});
120	
121	$('.vwmr_slider').slick({
122		  infinite: true,
123		  slidesToShow: 3,
124		  slidesToScroll: 3,
125		  autoplay: true,
126		  arrows: false,
127		  responsive: [
128			{
129				breakpoint: 1024,
130				settings: {
131					slidesToShow: 2,
132					slidesToScroll: 2 
133				}
134			},
135			  {
136				breakpoint: 770,
137				settings: {
138					slidesToShow: 2,
139					slidesToScroll: 2, 
140					arrows: true
141				}
142			},
143			  
144		]
145	});
146	
147	$('.rcp_flx').slick({
148		  infinite: true,
149		  slidesToShow: 2,
150		  slidesToScroll: 1,
151		  autoplay: true,
152		  arrows: false,
153		  responsive: [
154			{
155				breakpoint: 1024,
156				settings: {
157					slidesToShow: 1,
158					slidesToScroll: 1 
159				}
160			}
161		]
162	});
163	
164	$('.resp_slider').slick({
165		  infinite: true,
166		  slidesToShow: 1,
167		  slidesToScroll: 1,
168		  autoplay: false,
169		  arrows: true
170	});
171	
172	$('.bnn_slider').slick({
173		  infinite: true,
174		  slidesToShow: 1,
175		  slidesToScroll: 1,
176		  autoplay: true,
177		  arrows: false,
178		  responsive: [
179			{
180				breakpoint: 1024,
181				settings: {
182					adaptiveHeight: true
183				}
184			}
185		]
186	});
187	$('.tmsld_slider').slick({
188		  infinite: true,
189		  slidesToShow: 1,
190		  slidesToScroll: 1,
191		  autoplay: false,
192		  arrows: true,
193		  responsive: [
194			{
195				breakpoint: 1024,
196				settings: {
197					adaptiveHeight: true
198				}
199			}
200		]
201	});
202	$('.pdt_slider').slick({
203		  infinite: true,
204		  slidesToShow: 3,
205		  slidesToScroll: 1,
206		  autoplay: false,
207		  arrows: true,
208		  responsive: [
209			 {
210				breakpoint: 1025,
211				settings: {
212					slidesToShow: 2 
213				}
214			},
215			{
216				breakpoint: 767,
217				settings: {
218					slidesToShow: 1  
219				}
220			}
221		]
222	});
223
224	$('.mgtxt_sider').slick({
225		  infinite: true,
226		  slidesToShow: 1,
227		  slidesToScroll: 1,
228		  autoplay: false,
229		  arrows: true 
230	});
231
232	$("body").on("click", ".product-selector", function(){
233		$("#category-filters-container1").stop().slideToggle();
234		$(this).stop().toggleClass("active");
235	});
236	$("body").on("click", "#category-filters-container1 li label", function(){
237		$(".product-selector").stop().removeClass("active");
238		$("#category-filters-container1").stop().slideUp();
239		if(!$(".product-selector").hasClass("selected")) {
240			$(".product-selector").addClass("selected");
241		}
242		$(".product-selector img").remove();
243		$(this).children("img").clone().appendTo(".product-selector");
244		$(".product-selector span").text($(this).children("span").text());
245		if(!$(".bh-sl-filters-container").hasClass("active")) {
246			$(".bh-sl-filters-container").addClass("active");
247		}
248		$(".map-wrapper").stop().slideDown();
249		
250	});
251
252	$("body").on("click", "#category-filters-container2 li label .for-trigger", function(event){
253		//event.stopPropagation();
254		console.log("clicked");
255		if(!$(this).parent("label").parent("li").hasClass("active")) {
256			$("#category-filters-container2 li").removeClass("active");
257			$(this).parent("label").parent("li").addClass("active");
258			if($(this).parent("label").parent("li").hasClass("list1")) {
259				//$(".map-wrapper").addClass("list-only");
260			}
261			else {
262				$(".map-wrapper").removeClass("list-only");	
263			}
264			$(".map-wrapper").stop().slideDown();
265		}
266		else {
267			$(this).parent("label").parent("li").removeClass("active");
268			//$(".map-wrapper").stop().slideUp();
269		}
270		if(!$(".bh-sl-filters-container").hasClass("active")) {
271			$(".bh-sl-filters-container").addClass("active");
272		}
273		else {
274			$(".bh-sl-filters-container").removeClass("active");	
275		}
276	});
277
278	
279
280	// map
281	$('.mpls_click').on('click', function(){ 
282		var id = $(this).data('id'); 
283		
284		show_sidebar(id, false);
285	});
286	$('.mpls_back').on('click', function(){
287		$('.mpls_detail, .mpls_click, .map_box, .mpls_description').removeClass('active'); 
288	});
289	
290	$('.tml_items').on('click', function(){
291		$('.tml_items').removeClass('active');
292		$(this).addClass('active');
293		var id = $(this).data('id');
294		
295		show_sidebar(id);
296		
297		// scroll map
298		
299		var top = $('.mpls_click[data-id="'+id+'"]').offset().top - 200;
300		 $("html, body").animate({ scrollTop: top }, "slow"); 
301	});
302	
303	function show_sidebar(id, scroll){
304		setTimeout(function(){ 
305			
306				$('.mpls_description').hide().removeClass('active');
307				$('.mpls_description[data-id="'+id+'"]').show().addClass('active'); 
308				$('.mpls_detail').addClass('active');
309
310				$('.mpls_click').removeClass('active');
311				$('.mpls_click[data-id="'+id+'"]').addClass('active');
312
313				$('.map_box').addClass('active');
314
315				// scroll map
316				if(scroll){
317					// $(".map_box").animate({ scrollLeft: 0 }, 0);
318					var scroll_map = $(".map_box").scrollLeft();
319					
320					var height = $(window).height()/2;
321					var width = $(window).width()/2;
322					var item_top = $('.mpls_click[data-id="'+id+'"]').offset().top;
323					var item_left = $('.mpls_click[data-id="'+id+'"]').offset().left + scroll_map;
324					 
325					item_top -=height;
326					item_left -= width;
327
328					$("html, body").animate({ scrollTop: item_top }, "slow"); 
329					$(".map_box").animate({ scrollLeft: item_left }, 1200); 
330				}
331		},40);
332	}
333	
334	$('.arrow_btn').on('click', function(){
335		var id = 0;
336		if($('.mpls_description').hasClass('active')){
337		  id = parseInt($('.mpls_description.active').attr('data-id')); 
338		}
339		
340		if($(this).hasClass('arrow_prev')){
341			id -=1;
342		}else{
343			id +=1;
344		}
345		if(id !=0 && id < 14){
346			show_sidebar(id, true);
347		}
348	});
349	
350	$('.mpsft_btn').on('click', function(){
351		$('.map_show_first').hide();
352	});
353
354	
355	
356	// RTD
357	 
358	var hisSlider = $('.history_flx');
359		hisSlider.slick({
360			 fade: true,
361            cssEase: 'linear'
362		});	
363		hisSlider.on('beforeChange', function(event, slick, currentSlide, nextSlide){
364			$(".timeline .year_content p").removeClass("active");
365			$(".timeline .year_content p").eq(nextSlide).addClass("active");  
366		});
367	 $('.dot_year').on('click', function(){
368		 var id =parseInt($(this).data('slide')) - 1;
369		 hisSlider.slick('slickGoTo', id);
370	 });
371	
372});
373
374
375
376var goslingsrum = {
377	newRecipe: function(){
378		$('.order_sortby').on('change', function(){
379			var value = $(this).val();
380			if(value == 'desc'){
381				var length = $('.rpct_flx .rpct_item').length;
382				console.log(length);
383				var order=0;
384				for(var i = length; i >= 0; i -=1){
385					$('.rpct_flx .rpct_item[data-count="'+i+'"]').css('order', order);
386					order= order + 1;
387				}
388			}else{
389				$('.rpct_flx .rpct_item').css('order', 0);
390			}
391			 
392		});
393		$('.flvl_clear').on('click', function(){
394			$('.rpctft_filter').val(0);
395			$(this).hide();
396			$('.rpct_flx .rpct_item').show();
397			$('.flvl_close').hide();
398		});
399		
400		$('.flvl_close').on('click', function(){
401			$(this).hide();
402			var count = $(this).data('count');
403			$('.rpctft_filter[data-count="'+count+'"]').val(0);
404			
405			var var1 = $('.rpctft_level').val();
406			var var2 = $('.rpctft_Ingredients').val();
407			var var3 = $('.rpctft_time').val();
408			
409			filter_val(var1, var2, var3);
410		});
411		
412		$('.rpctft_filter').on('change', function(){
413			var var1 = $('.rpctft_level').val();
414			var var2 = $('.rpctft_Ingredients').val();
415			var var3 = $('.rpctft_time').val();
416			
417			filter_val(var1, var2, var3);
418		});
419		
420		
421		
422		function filter_val(var1, var2, var3){
423			$('.rpct_flx .rpct_item').each(function(){
424				var level = $(this).data('level');
425				var ingredients = $(this).data('ingredients');
426				var time = $(this).data('time');
427				if((var1 == '0' || var1 == level) && (var2 == '0' || var2 == ingredients) && (var3 == '0' || var3 == time) ){
428					 $(this).show();
429				}else{
430					 $(this).hide();
431				} 
432			});
433			
434			// set value 
435			if(var1 != '0'){
436				 $('.flvl_nav .flvl_val[data-count="1"]').show();
437				 $('.flvl_nav .flvl_val[data-count="1"] .flvl_txt').html(var1);
438		     }else{
439				 $('.flvl_nav .flvl_val[data-count="1"]').hide();
440			 }
441			
442			if(var2 != '0'){
443				 $('.flvl_nav .flvl_val[data-count="2"]').show();
444				 $('.flvl_nav .flvl_val[data-count="2"] .flvl_txt').html(var2);
445		     }else{
446				 $('.flvl_nav .flvl_val[data-count="2"]').hide();
447			 }
448			
449			if(var3 != '0'){
450				 $('.flvl_nav .flvl_val[data-count="3"]').show();
451				 $('.flvl_nav .flvl_val[data-count="3"] .flvl_txt').html(var3);
452		     }else{
453				 $('.flvl_nav .flvl_val[data-count="3"]').hide();
454			 }
455			
456			// clear
457			if(var1 == '0' && var2 == '0' && var3 == '0'){
458				$('.flvl_clear').hide();
459			}else{
460				$('.flvl_clear').show();
461			}
462		}
463		 
464	},
465	product_app_data: function(){
466		setTimeout(function(){
467			 var video = $('.full_video .video_url').text();
468			 var img = $('.full_video .video_img img').attr('src');
469			var id = $('.full_video .video_id').text();
470			 
471			if(typeof video !== "undefined" && video != '' && video != 'undefined'){
472				$('.full_video .video_append').html('<iframe width="100%" height="100%" src="'+video+'?rel=0&amp;autoplay=1&mute=1&loop=1&playlist='+id+'"></iframe>');
473			}
474			
475			var html = $('.scent_flavor_img [liquid-pim-img="scent_flavor_statement_image_1"]').html();
476			console.log(html);
477			if(html == 'undefined'){
478				$('.scent_flavor').hide();
479			}
480			
481		}, 2500);
482		
483		setInterval(function(){
484			var html = $('.scent_flavor_img [liquid-pim-img="scent_flavor_statement_image_1"]').html();
485			console.log(html);
486			if(html == 'undefined'){
487				$('.scent_flavor').hide();
488			}
489		}, 4500);
490		
491		function update_text(){
492			$('.liquid-fulfillment-method-selector h3').html('Ship'); // ('Deliver Same Day');
493			
494			if($('.liquid-fulfillment-method-selector h3').length >= 2){
495				$('.liquid-fulfillment-method-selector  h3:nth-child(1)').html('Schedule');
496			}
497			
498			// size qty
499			var html = $('.pdst_ul .pdst_list').html();
500			if(html == ''){
501				$('.size_qyt_box').hide();
502			}else{
503				$('.size_qyt_box').show();
504			}
505			
506		}
507	 
508	},
509	all_option: function(){
510		$('.vwmr_select').on('change', function(){
511			$('.vwmr_item').hide();
512			var id = $(this).val();
513			$('.vwmr_item[data-type="'+id+'"]').show();
514		});
515	   $('.vwmr_list').on('click', function(){
516		  	var type = $(this).data('value');
517		   var top = $('.vwmr_subheding[data-type="'+type+'"]').offset().top;
518		   if($(window).width() < 768){
519			   top -=185;
520		   }
521		   $('html, body').animate({
522			  scrollTop: top
523		    }, 100);
524	   });
525		
526	 $('.szct_btn').on('click', function(){
527		 $('.szct_popup').show();
528	 });
529	$('.szct_bg, .szct_close').on('click', function(){
530		 $('.szct_popup').hide();
531	 });
532		
533	}
534}
535
536$(function(){
537	goslingsrum.newRecipe();
538	goslingsrum.product_app_data();
539	goslingsrum.all_option();
540});
541
542
543$(window).scroll(function() {
544    var scrollTop = $(window).scrollTop();   
545	
546	// banner image scroll
547	var rotation =  scrollTop/7;
548	$('.img-wrap').css({'-webkit-transform' : 'rotate('+ rotation +'deg)',
549                 '-moz-transform' : 'rotate('+ rotation +'deg)',
550                 '-ms-transform' : 'rotate('+ rotation +'deg)',
551                 'transform' : 'rotate('+ rotation +'deg)'});
552	
553	
554	// image zoomin out 
555	var zoom =  100 - scrollTop/12; 
556	if(zoom <= 100 && zoom >= 75){ 
557		 $('#bnn_img_scroll').css('width', zoom+'%');
558	}
559	 
560});
561
562 
563

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.