PageSourceSearch

https://teemdrop.com/static/js/pages/serviceList/03.js?v=

js teemdrop.com collected 2026-10-03 21:39:15 UTC 1,731 bytes, 74 lines download raw bytes

1// <-- !轮播图开始 -->
2const slider = document.getElementById('slider')
3const slides = slider.querySelectorAll('.slide')
4
5let currentIndex = 0
6let slideCount = slides.length
7let autoPlayInterval
8let isAutoPlay = true
9
10// 切换到指定幻灯片
11function goToSlide(index) {
12  if (index < 0) {
13    currentIndex = slideCount - 1
14  } else if (index >= slideCount) {
15    currentIndex = 0
16  } else {
17    currentIndex = index
18  }
19
20  slider.style.transform = `translateX(-${currentIndex * 100}%)`
21}
22
23// 下一张幻灯片
24function nextSlide() {
25  goToSlide(currentIndex + 1)
26}
27
28// 上一张幻灯片
29function prevSlide() {
30  goToSlide(currentIndex - 1)
31}
32
33// 自动播放功能
34function startAutoPlay() {
35  if (isAutoPlay) {
36    autoPlayInterval = setInterval(() => {
37      nextSlide()
38    }, 5000)
39  }
40}
41
42// 初始化轮播图
43function initSlider() {
44  startAutoPlay()
45
46  // 鼠标悬停时暂停自动播放
47  slider.parentElement.addEventListener('mouseenter', () => {
48    if (isAutoPlay) {
49      clearInterval(autoPlayInterval)
50    }
51  })
52
53  // 鼠标离开时恢复自动播放
54  slider.parentElement.addEventListener('mouseleave', () => {
55    if (isAutoPlay) {
56      startAutoPlay()
57    }
58  })
59}
60// 初始化轮播图
61initSlider()
62
63document.addEventListener('click', function (e) {
64  const el = e.target.closest('.sixth-block-box-title')
65  if (!el) return
66  el.querySelector('.sixth-block-box-title-img').classList.toggle('active')
67  el.nextElementSibling.classList.toggle('show')
68  document.querySelectorAll('.sixth-block-box-title').forEach(item => {
69    if (item !== el) {
70      item.querySelector('.sixth-block-box-title-img').classList.remove('active')
71      item.nextElementSibling.classList.remove('show')
72    }
73  })
74})

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.