自动滚动 随悬停停止
This commit is contained in:
parent
e8c74caab7
commit
de0665b336
@ -40,6 +40,10 @@
|
||||
</div>
|
||||
<div
|
||||
class="mt-[140px] mb-[230px] carousel-container px-[80px] py-[40px] z-6"
|
||||
@mouseenter="pauseCarouselAnimation"
|
||||
@mouseleave="resumeCarouselAnimation"
|
||||
@touchstart="pauseCarouselAnimation"
|
||||
@touchend="resumeCarouselAnimation"
|
||||
>
|
||||
<div ref="carouselTrack" class="carousel-track">
|
||||
<div
|
||||
@ -751,6 +755,19 @@ const goToSection = (i) => {
|
||||
const handleLink = (url) => {
|
||||
window.open(url);
|
||||
};
|
||||
|
||||
// 添加轮播动画暂停和恢复函数
|
||||
const pauseCarouselAnimation = () => {
|
||||
if (carouselAnimation) {
|
||||
carouselAnimation.pause();
|
||||
}
|
||||
};
|
||||
|
||||
const resumeCarouselAnimation = () => {
|
||||
if (carouselAnimation) {
|
||||
carouselAnimation.play();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
Loading…
Reference in New Issue
Block a user