PageSourceSearch

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

js teemdrop.com collected 2026-10-03 21:39:17 UTC 1,304 bytes, 63 lines download raw bytes

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

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.