|
|
@@ -75,6 +75,8 @@ function A2main() {
|
|
|
}
|
|
|
}
|
|
|
const sectionBoxRef = useRef<HTMLDivElement>(null)
|
|
|
+ const [currentSectionIndex, setCurrentSectionIndex] = useState(0)
|
|
|
+
|
|
|
const [isActive, setIsActive] = useState(true)
|
|
|
// 滚动到最左
|
|
|
|
|
|
@@ -102,11 +104,16 @@ function A2main() {
|
|
|
slidesToShow: 1,
|
|
|
slidesToScroll: 1,
|
|
|
adaptiveHeight: true,
|
|
|
- prevArrow: <div className="slick-prev">
|
|
|
- <img src={require('@/assets/img/left.png')} alt="" />
|
|
|
+ prevArrow: <div className="slick-prev " >
|
|
|
+ <img
|
|
|
+ className="sectionCont"
|
|
|
+ src={require('@/assets/img/left.png')}
|
|
|
+ alt=""
|
|
|
+ data-index={Math.abs((currentSectionIndex) % 3)} onClick={() => setCurrentSectionIndex(currentSectionIndex - 1)}
|
|
|
+ />
|
|
|
</div>,
|
|
|
- nextArrow: <div className="slick-next">
|
|
|
- <img src={require('@/assets/img/right.png')} alt="" />
|
|
|
+ nextArrow: <div className="slick-next" >
|
|
|
+ <img className='sectionCont' src={require('@/assets/img/right.png')} alt="" data-index={Math.abs((currentSectionIndex + 2) % 3)} onClick={() => setCurrentSectionIndex(currentSectionIndex + 1)} />
|
|
|
</div>,
|
|
|
};
|
|
|
|