Skip to content

Commit 5fe068b

Browse files
committed
Revert "文件调整 将相关script调整至js文件中而非在index.html下"
This reverts commit e4d199f
1 parent dd1394e commit 5fe068b

File tree

8 files changed

+262
-299
lines changed

8 files changed

+262
-299
lines changed

css/range.css

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
margin: auto; /* 在水平方向自动调整外边距,实现居中 */
88
}
99

10+
/* 其他样式保持不变 */
11+
1012
.carousel .slides {
1113
display: flex;
1214
padding: 0;

index.html

+259-26
Large diffs are not rendered by default.

js/DOMContent.js

-67
This file was deleted.

js/animation.js

-24
This file was deleted.

js/cookies.js

-18
This file was deleted.

js/custom.js

+1-47
Original file line numberDiff line numberDiff line change
@@ -27,52 +27,6 @@
2727
}
2828
});
2929

30-
// CAROUSEL LOGIC
31-
(function carouselLogic($) {
32-
var currentSlide = 0;
33-
var slides = $('.slides img');
34-
var dots = $('.nav-dots .dot a');
35-
var arrowLeft = $('.arrow-left a');
36-
var arrowRight = $('.arrow-right a');
30+
})(window.jQuery);
3731

38-
function showSlide(n) {
39-
if (n >= slides.length) {
40-
n = 0;
41-
}
42-
if (n < 0) {
43-
n = slides.length - 1;
44-
}
4532

46-
slides.each(function (index) {
47-
$(this).css('display', 'none');
48-
});
49-
slides.eq(n).css('display', 'block');
50-
51-
// 更新导航点的激活状态
52-
dots.each(function (index) {
53-
$(this).removeClass('active');
54-
});
55-
dots.eq(n).addClass('active');
56-
}
57-
58-
function updateDots() {
59-
dots.each(function (index) {
60-
$(this).on('click', function () {
61-
showSlide(index);
62-
});
63-
});
64-
}
65-
66-
arrowLeft.on('click', function () {
67-
showSlide(currentSlide -= 1);
68-
});
69-
70-
arrowRight.on('click', function () {
71-
showSlide(currentSlide += 1);
72-
});
73-
74-
showSlide(currentSlide);
75-
updateDots();
76-
})(jQuery);
77-
78-
})(window.jQuery);

js/range.js

-85
This file was deleted.

js/running-time.js

-32
This file was deleted.

0 commit comments

Comments
 (0)