PageSourceSearch

https://www.labenchile.cl/laben/js-local/js-global-av-1781732351-av-.js

js labenchile.cl collected 2026-10-08 22:18:59 UTC 19,158 bytes, 719 lines download raw bytes

1/*====carrusel 1 slide ===*/
2
3$('.swiper-1').each(function(index, element) {
4  var $this = $(this);
5  $this.addClass('instance-m1-' + index);
6  $this.find('.swiper-pagination').addClass('pagination1-' + index);
7  $this.find('.swiper-button-prev').addClass('btn-prev1-' + index);
8  $this.find('.swiper-button-next').addClass('btn-next1-' + index);
9
10  var swiper1 = new Swiper('.instance-m1-' + index, {
11
12      slidesPerView: 1,
13      loop: true,
14      noSwiping: true,
15      autoHeight: true,
16      autoplay: {
17        delay: 4000,               // 4 segundos
18        disableOnInteraction: false // sigue después de clicks o drag
19      },
20      navigation: {
21          nextEl: '.btn-next1-' + index,
22          prevEl: '.btn-prev1-' + index,
23      },
24      pagination: {
25          el: '.pagination1-' + index,
26          clickable: true,
27      },
28
29  });
30
31  // Pausar en hover
32  $this.on('mouseenter', function() {
33    swiper1.autoplay.stop()
34  })
35
36  // Reanudar al salir
37  $this.on('mouseleave', function() {
38    swiper1.autoplay.start()
39  })
40
41});
42
43/*====carrusel 3 slide ===*/
44
45$('.swiper-3').each(function(index, element) {
46  var $this = $(this);
47  $this.addClass('instance3-' + index);
48  $this.find('.swiper-pagination').addClass('pagination3-' + index);
49  $this.find('.swiper-button-prev').addClass('btn-prev3-' + index);
50  $this.find('.swiper-button-next').addClass('btn-next3-' + index);
51
52  var swiper3s = new Swiper('.instance3-' + index, {
53
54      slidesPerView: 3,
55      spaceBetween: 20,
56      loop: false,
57      autoplay: {
58        delay: 6000,               // 8 segundos
59        disableOnInteraction: false // sigue después de clicks o drag
60      },
61      pagination: {
62          el: '.pagination3-' + index,
63          clickable: true,
64      },
65      navigation: {
66          nextEl: '.btn-next3-' + index,
67          prevEl: '.btn-prev3-' + index,
68      },
69      breakpoints: {
70          1024: {
71              slidesPerView: 3,
72              spaceBetween: 20,
73          },
74          880: {
75              slidesPerView: 3,
76              spaceBetween: 18,
77          },
78          675: {
79              slidesPerView: 2,
80              spaceBetween: 18,
81          },
82          460: {
83              CSSWidthAndHeight: true,
84              slidesPerView: 'auto',
85              spaceBetween: 18,
86              slidesOffsetBefore: 15,
87              slidesOffsetAfter: 15,
88              loop: false,
89          },
90          320: {
91              CSSWidthAndHeight: true,
92              slidesPerView: 'auto',
93              spaceBetween: 18,
94              slidesOffsetBefore: 15,
95              slidesOffsetAfter: 15,
96              loop: false,
97          }
98      },
99
100  });
101
102  // Pausar en hover
103  $this.on('mouseenter', function() {
104    swiper3s.autoplay.stop()
105  })
106
107  // Reanudar al salir
108  $this.on('mouseleave', function() {
109    swiper3s.autoplay.start()
110  })
111
112});
113/*====carrusel 4 slide ===*/
114
115$('.swiper-4').each(function(index, element) {
116  var $this = $(this);
117  $this.addClass('instance-m4-' + index);
118  $this.find('.swiper-pagination').addClass('pagination-' + index);
119  $this.find('.swiper-button-prev').addClass('btn-prev4-' + index);
120  $this.find('.swiper-button-next').addClass('btn-next4-' + index);
121
122  var swiper4 = new Swiper('.instance-m4-' + index, {
123
124      slidesPerView: 4,
125      spaceBetween: 34,
126      init: true,
127      watchOverflow: true, // deshabilita flechas si hay menos elementos
128      autoplay: {
129        delay: 6000,               // 8 segundos
130        disableOnInteraction: false // sigue después de clicks o drag
131      },
132      pagination: {
133          el: '.pagination-' + index,
134          clickable: true,
135      },
136      navigation: {
137          nextEl: '.btn-next4-' + index,
138          prevEl: '.btn-prev4-' + index,
139      },
140      breakpoints: {
141          1300: {
142              slidesPerView: 4,
143              spaceBetween: 18,
144          },
145          1024: {
146            slidesPerView: 3,
147            spaceBetween: 18,
148          },
149          940: {
150              slidesPerView: 2,
151              spaceBetween: 18,
152          },
153          675: {
154              slidesPerView: 2,
155              spaceBetween: 18,
156          },
157          460: {
158              CSSWidthAndHeight: true,
159              slidesPerView: 'auto',
160              spaceBetween: 14,
161              slidesOffsetBefore: 10,
162              slidesOffsetAfter: 10,
163          },
164          320: {
165              CSSWidthAndHeight: true,
166              slidesPerView: 'auto',
167              spaceBetween: 14,
168              slidesOffsetBefore: 10,
169              slidesOffsetAfter: 10,
170          }
171      },
172
173  });
174
175  // Pausar en hover
176  $this.on('mouseenter', function() {
177    swiper4.autoplay.stop()
178  })
179
180  // Reanudar al salir
181  $this.on('mouseleave', function() {
182    swiper4.autoplay.start()
183  })
184
185});
186
187/*====carrusel 5 slide ===*/
188
189$('.swiper-5').each(function(index, element) {
190  var $this = $(this);
191  $this.addClass('instance-m5-' + index);
192  $this.find('.swiper-pagination').addClass('pagination-' + index);
193  $this.find('.swiper-button-prev').addClass('btn-prev5-' + index);
194  $this.find('.swiper-button-next').addClass('btn-next5-' + index);
195
196  var swiper5 = new Swiper('.instance-m5-' + index, {
197
198      slidesPerView: 5,
199      spaceBetween: 30,
200      init: true,
201      watchOverflow: true, // deshabilita flechas si hay menos elementos
202      autoplay: {
203        delay: 6000,               // 8 segundos
204        disableOnInteraction: false // sigue después de clicks o drag
205      },
206      pagination: {
207          el: '.pagination-' + index,
208          clickable: true,
209      },
210      navigation: {
211          nextEl: '.btn-next5-' + index,
212          prevEl: '.btn-prev5-' + index,
213      },
214      breakpoints: {
215          1300: {
216              slidesPerView: 5,
217              spaceBetween: 18,
218          },
219          1024: {
220            slidesPerView: 4,
221            spaceBetween: 18,
222          },
223          940: {
224              slidesPerView: 4,
225              spaceBetween: 18,
226          },
227          675: {
228              slidesPerView: 3,
229              spaceBetween: 18,
230          },
231          460: {
232              CSSWidthAndHeight: true,
233              slidesPerView: 'auto',
234              spaceBetween: 14,
235              slidesOffsetBefore: 10,
236              slidesOffsetAfter: 10,
237          },
238          320: {
239              CSSWidthAndHeight: true,
240              slidesPerView: 'auto',
241              spaceBetween: 14,
242              slidesOffsetBefore: 10,
243              slidesOffsetAfter: 10,
244          }
245      },
246
247  });
248
249  // Pausar en hover
250  $this.on('mouseenter', function() {
251    swiper5.autoplay.stop()
252  })
253
254  // Reanudar al salir
255  $this.on('mouseleave', function() {
256    swiper5.autoplay.start()
257  })
258
259});
260
261/*====carrusel 6 slide ===*/
262
263$('.swiper-6').each(function(index, element) {
264  var $this = $(this);
265  $this.addClass('instance-m6-' + index);
266  $this.find('.swiper-pagination').addClass('pagination-' + index);
267  $this.find('.swiper-button-prev').addClass('btn-prev6-' + index);
268  $this.find('.swiper-button-next').addClass('btn-next6-' + index);
269
270  var swiper6 = new Swiper('.instance-m6-' + index, {
271
272      slidesPerView: 6,
273      spaceBetween: 34,
274      init: true,
275      observer: true,
276      loop: false,
277      observeParents: true,
278      watchOverflow: true, // deshabilita flechas si hay menos elementos
279      autoplay: {
280        delay: 6000,               // 8 segundos
281        disableOnInteraction: false // sigue después de clicks o drag
282      },
283      pagination: {
284          el: '.pagination-' + index,
285          clickable: true,
286      },
287      navigation: {
288          nextEl: '.btn-next6-' + index,
289          prevEl: '.btn-prev6-' + index,
290      },
291      breakpoints: {
292          1190: {
293              slidesPerView: 6,
294              spaceBetween: 20,
295              observeParents: true,
296              watchOverflow: true, // deshabilita flechas si hay menos elementos
297          },
298          940: {
299              slidesPerView: 4,
300              spaceBetween: 15,
301          },
302          675: {
303              slidesPerView: 3,
304              spaceBetween: 15,
305          },
306          460: {
307              CSSWidthAndHeight: true,
308              slidesPerView: 'auto',
309              spaceBetween: 20,
310              slidesOffsetBefore: 10,
311              slidesOffsetAfter: 10,
312          },
313          320: {
314              CSSWidthAndHeight: true,
315              slidesPerView: 'auto',
316              spaceBetween: 20,
317              slidesOffsetBefore: 10,
318              slidesOffsetAfter: 10,
319          }
320        },
321
322    });
323
324    // Pausar en hover
325  $this.on('mouseenter', function() {
326    swiper6.autoplay.stop()
327  })
328
329  // Reanudar al salir
330  $this.on('mouseleave', function() {
331    swiper6.autoplay.start()
332  })
333
334});
335
336/*====carrusel 7 slide ===*/
337
338$('.swiper-7').each(function(index, element) {
339  var $this = $(this);
340  $this.addClass('instance-m7-' + index);
341  $this.find('.swiper-pagination').addClass('pagination-' + index);
342  $this.find('.swiper-button-prev').addClass('btn-prev7-' + index);
343  $this.find('.swiper-button-next').addClass('btn-next7-' + index);
344
345  var swiper7 = new Swiper('.instance-m7-' + index, {
346
347      slidesPerView: 7,
348      spaceBetween: 34,
349      init: true,
350      observer: true,
351      loop: true,
352      observeParents: true,
353      watchOverflow: true, // deshabilita flechas si hay menos elementos
354      autoplay: {
355        delay: 6000,               // 8 segundos
356        disableOnInteraction: false // sigue después de clicks o drag
357      },
358      pagination: {
359          el: '.pagination-' + index,
360          clickable: true,
361      },
362      navigation: {
363          nextEl: '.btn-next7-' + index,
364          prevEl: '.btn-prev7-' + index,
365      },
366      breakpoints: {
367          1190: {
368              slidesPerView: 7,
369              spaceBetween: 20,
370          },
371          940: {
372              slidesPerView: 4,
373              spaceBetween: 15,
374          },
375          675: {
376              slidesPerView: 2,
377              spaceBetween: 15,
378          },
379          460: {
380              CSSWidthAndHeight: true,
381              slidesPerView: 'auto',
382              spaceBetween: 15,
383              slidesOffsetBefore: 10,
384              slidesOffsetAfter: 10,
385          },
386          320: {
387              CSSWidthAndHeight: true,
388              slidesPerView: 'auto',
389              spaceBetween: 15,
390              slidesOffsetBefore: 10,
391              slidesOffsetAfter: 10,
392          }
393        },
394
395    });
396
397    // Pausar en hover
398  $this.on('mouseenter', function() {
399    swiper7.autoplay.stop()
400  })
401
402  // Reanudar al salir
403  $this.on('mouseleave', function() {
404    swiper7.autoplay.start()
405  })
406});
407
408/*====carrusel ancho automático ===*/
409
410$('.swiper-auto').each(function(index, element){
411  var $this = $(this);
412  $this.addClass('instance-auto-' + index);
413  $this.find('.swiper-pagination').addClass('pagination-auto-' + index);
414  $this.find('.swiper-button-prev').addClass('btn-prev-auto-' + index);
415  $this.find('.swiper-button-next').addClass('btn-next-auto-' + index);
416
417  var swiperauto = new Swiper('.instance-auto-' + index, {
418
419      slidesPerView: 'auto',
420      loop: false,
421      CSSWidthAndHeight: true,
422      init: true,
423      pagination: {
424        el: '.pagination-auto-' + index,
425        clickable: true,
426      },
427      navigation: {
428        nextEl: '.btn-next-auto-' + index,
429        prevEl: '.btn-prev-auto-' + index,
430      },
431  });
432
433});
434
435$('.swiper-center').each(function(index, element){
436  var $this = $(this);
437  $this.addClass('instance-center-' + index);
438  $this.find('.swiper-pagination').addClass('pagination-center-' + index);
439  $this.find('.swiper-button-prev').addClass('btn-prev-center-' + index);
440  $this.find('.swiper-button-next').addClass('btn-next-center-' + index);
441
442  var swipercenter = new Swiper('.instance-center-' + index, {
443
444      slidesPerView: 'auto',
445      loop: true,
446      CSSWidthAndHeight: true,
447      centeredSlides: true,
448      noSwiping: true,
449      autoHeight: true,
450      spaceBetween: 0,
451      init: true,
452      watchOverflow: true, // deshabilita flechas si hay menos elementos
453      pagination: {
454        el: '.pagination-center-' + index,
455        clickable: true,
456      },
457      navigation: {
458        nextEl: '.btn-next-center-' + index,
459        prevEl: '.btn-prev-center-' + index,
460      }
461
462  });
463
464});
465
466/*==== Despliegue barra de búsqueda===*/
467
468function addClass(el, className) {
469  var el = document.querySelectorAll(el);
470  
471  for (i = 0; i < el.length; i++) {
472    if (el.classList) {
473      el[i].classList.add(className);
474    } else {
475      el[i].className += ' ' + className;
476
477    }
478  }
479}
480
481function removeClass(el, className) {
482    var el = document.querySelectorAll(el);
483    
484    for (i = 0; i < el.length; i++) {
485
486      if (el[i].classList) {
487        el[i].classList.remove(className);
488      } else {
489        el[i].className = el.className.replace(new RegExp('(^|\\b)' + className.split(' ').join('|') + '(\\b|$)', 'gi'), ' ');
490      }
491    }
492}
493
494
495/*==== Despliegue submenu móvil===*/
496$(document).ready(function(){
497
498var accItem = document.getElementsByClassName('accordionItem');
499  var accHD = document.getElementsByClassName('link');
500  for (i = 0; i < accHD.length; i++) {
501      accHD[i].addEventListener('click', toggleItem, false);
502  }
503  function toggleItem() {
504      var itemClass = this.parentNode.className;
505      for (i = 0; i < accItem.length; i++) {
506          accItem[i].className = 'accordionItem close';
507      }
508      if (itemClass == 'accordionItem close') {
509          this.parentNode.className = 'accordionItem open';
510      }
511  }
512
513});
514
515
516/*==== header sticky ===*/
517
518$(document).ready(function(){
519  window.onscroll = function() {myFunction()};
520
521  var header = document.getElementById("header");
522  var sticky = header.offsetTop;
523  
524  function myFunction() {
525    if (window.pageYOffset > sticky) {
526      header.classList.add("sticky");
527    } else {
528      header.classList.remove("sticky");
529    }
530
531  }
532
533});
534
535// ===== Scroll to Top ==== //
536$(document).ready(function(){
537
538  $(window).scroll(function() {
539      if ($(this).scrollTop() >= 50) {        // If page is scrolled more than 50px
540          $('#return-to-top').fadeIn(200);    // Fade in the arrow
541      } else {
542          $('#return-to-top').fadeOut(200);   // Else fade out the arrow
543      }
544  });
545  $('#return-to-top').click(function() {      // When arrow is clicked
546      $('body,html').animate({
547          scrollTop : 0                       // Scroll to top of body
548      }, 500);
549  });
550  
551  });
552
553/*==== menujq Accordion ===*/
554$(document).ready(function(){
555  $('.menujq > ul > li:has(ul)').addClass('desplegable');
556    $('.menujq > ul > li > a').click(function() {
557      var comprobar = $(this).next();
558      $('.menujq li').removeClass('active');
559      $(this).closest('li').addClass('active');
560      if((comprobar.is('ul')) && (comprobar.is(':visible'))) {
561        $(this).closest('li').removeClass('active');
562        comprobar.slideUp('normal');
563    }
564    if((comprobar.is('ul')) && (!comprobar.is(':visible'))) {
565      $('.menujq ul ul:visible').slideUp('normal');
566      comprobar.slideDown('normal');
567    }
568  });
569});
570
571//menu mobile activo
572$(document).ready(function(){
573  $(".menu-responsive .menu-icon").on('click', function(){
574    $('.menu-responsive').toggleClass('active');
575    $(this).addClass('active')
576  })
577})
578function savesubcat(){
579  return null
580}
581
582/*====Despliegue accesibilidad===*/
583$(document).ready(function(){
584
585  $('.ic-access').click(function(e){
586    e.preventDefault();
587    $('.acc-cont').toggleClass('active');
588    $(this).toggleClass('change');
589  });
590  
591});
592
593hide = true;
594$('.search-icon').on("click", function () {
595    if (hide) $('.acc-cont').removeClass('active');
596    $('.ic-access').removeClass('change');
597    hide = true;
598});
599
600
601// smooth scroll anchor
602function scrollToTargetWithOffset(target, offset) {
603  const targetElement = target === 'top' ? document.body : document.getElementById(target);
604
605  if (targetElement) {
606      window.scrollTo({
607          top: target === 'top' ? 0 : targetElement.offsetTop - offset,
608          behavior: 'smooth'
609      });
610  }
611}
612
613document.querySelectorAll('a[href^="#"]:not([href="#"])').forEach(anchor => {
614  anchor.addEventListener('click', function (e) {
615      e.preventDefault();
616
617      const target = this.getAttribute('href').substring(1);
618      const offset = 160;
619      scrollToTargetWithOffset(target, offset);
620  });
621});
622
623// switch contraste
624$(document).ready(function () {
625  const themeSwitch = document.querySelector("#toggle-theme");
626  themeSwitch.addEventListener("change", () => {
627    document.body.classList.toggle("contraste");
628  });
629  const themeSwitchMobile = document.querySelector("#toggle-theme-mobile");
630  themeSwitchMobile.addEventListener("change", () => {
631    document.body.classList.toggle("contraste");
632  });
633
634  $("#toggle-theme").on("click", function () {
635    $(this).parent().toggleClass("checked");
636  });
637});
638
639//ancla activa
640$(document).ready(function(){
641  $(".sticky-anchor li").on('click', function(){
642    $(this).siblings().removeClass('active');
643    $(this).addClass('active')
644  })
645})
646function savesubcat(){
647  return null
648}
649
650
651$(window).scroll(function() {
652  var scrollDistance = $(window).scrollTop();
653
654  // Assign active class to nav links while scolling
655  $('.page-section').each(function(i) {
656      if ($(this).position().top <= scrollDistance) {
657          $('.navigation a.active').removeClass('active');
658          $('.navigation a').eq(i).addClass('active');
659      }
660  });
661}).scroll();
662
663//despliegue buscador mobile
664var isOpen = false;
665var searchBox = document.getElementById("searchBox");
666
667function toggleSearch() {
668  searchBox.classList.toggle("active");
669  isOpen = !isOpen;
670}
671
672// Manejar la interacción del submenú
673document.querySelectorAll('.sub-menu__item').forEach(item => {
674  item.addEventListener('mouseenter', () => {
675      document.querySelectorAll('.sub-menu__item').forEach(el => el.classList.remove('active'));
676      document.querySelectorAll('.sub-menu__content').forEach(content => content.classList.remove('active'));
677      
678      item.classList.add('active');
679      document.getElementById(item.dataset.content).classList.add('active');
680  });
681  });
682
683// Cifras
684document.addEventListener("DOMContentLoaded", () => {
685  const counters = document.querySelectorAll(".stats__number")
686  let animated = false
687
688  function animateCounters() {
689    counters.forEach(counter => {
690      const updateCount = () => {
691        const target = +counter.getAttribute("data-target")
692        const count = +counter.innerText
693        const increment = target / 100 // velocidad
694
695        if (count < target) {
696          counter.innerText = Math.ceil(count + increment)
697          requestAnimationFrame(updateCount)
698        } else {
699          counter.innerText = target
700        }
701      }
702      updateCount()
703    })
704  }
705
706  // Detectar cuando entra en el viewport
707  const observer = new IntersectionObserver(entries => {
708    entries.forEach(entry => {
709      if (entry.isIntersecting && !animated) {
710        animateCounters()
711        animated = true
712      }
713    })
714  }, { threshold: 0.5 })
715  if (document.querySelector(".stats") != null){
716    observer.observe(document.querySelector(".stats"))
717  }
718  
719})

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.